Several Methods for converting word into concise HTML to clear and copy word spam code, and converting word to HTML

Source: Internet
Author: User

 

Several Methods to convert Word into concise HTML-webpage design Column

 

Word can be directly saved as htm, but even if it is saved as HTML, there will be a lot of waste.Code. Previously, I used the clean up HTML in Dreamweaver to process the unique word tags first, and then delete some font, B, and span tags. Further, use regular expressions in editplus to process the code, and finally get the clean HTML code I want. Of course, the most perfect way is to copy the text and write the HTM tag in the text editor ,:)

Today, we can see the following methods of lifehacker word 2 clean HTM:

1. Use the HTML tidy library project open-source software for processing.

2. Microsoft official site also has an Office 2000 HTML filter 2.0 tool that can be used to process unnecessary code generated when Word2000 is converted to HTML.

3. Use this word HTML cleaner online tool for processing. Only versions below Word2000 can be processed.

4. Some people have given regular expressions (in fact, the above software also uses regular expressions)

Delete unnecessary tags

<[/]? (Font | span | XML | [ovwxp]: W +) [^>] *?>
-Replace any matches with the empty string

Delete unnecessary attributes such as class and style...

<([^>] *) (? : Class | Lang | style | size | face | [ovwxp]: W +) = (? : '[^'] * '| "" [^ ""] * "" | [^>] +) ([^>] *)>
-Replace any matches with <$1 $2>

For more information, see clean word HTML using regular expressions.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.