My HTML tidy Configuration

Source: Internet
Author: User
Tags tidy
HTML tidy configuration options


Most of our current websites are html. If you want to standardize them, It is very troublesome to manually modify one page at a time. If there is a tool that can automatically convert HTML into conforming XHTML. In fact, there are already a lot of commercial and free tool software available in this regard. Here we will introduce the HTML tidy as a very basic but useful tool that can run on multiple platforms, it is also open source code.


HTML tidyIt is a software and function library capable of HTML file errors and neat code arrangement (that is, contraction.

HTML tidy is developed by Dave raggett of W3C and becomes a SourceForge project. Its source code is written in ansi c, the execution files suitable for different operating systems can be compiled accordingly. HTML tidy is released under W3C license (loose BSD license) authorization.


Fixed HTML errors such:

  • Element end tag missing or mismatch element tag
  • Return missing items (such as element tags, quotation marks, etc ...)
  • Whether the returned file uses private HTML elements or extensions
  • Change the layout according to the preset Style
  • Convert some encoded characters to HTML characters
  • Clear rendered Elements

 [Myformat] <br/> Add-XML-Decl = No <br/> Add-XML-Space = No <br/> alt-TEXT = <br/> assume-XML -procins = No <br/> bare = No <br/> Break-before-Br = No <br/> clean = No <br/> doctype = auto <br/> drop-empty-paras = Yes <br/> drop-font-tags = Yes <br/> drop-proprietary-attributes = No <br/> enclose-block-TEXT = Yes <br/> enclose-TEXT = Yes <br/> escape-CDATA = No <br/> fix-bad-Comments = Yes <br/> fix-uri = Yes <br /> hide-Comments = No <br/> hide-endtags = No <br/> indent-CDATA = No <br/> input-xml = No <br/> join- classes = No <br/> join-styles = Yes <br/> logical-emphasis = Yes <br/> lower-literals = Yes <br/> NCR = Yes <br/> New-blocklevel-tags = <br/> New-empty-tags = <br/> New-inline-tags = <br/> New-Pre-tags = <br/> Numeric-entities = No <br/> output-XHTML = No <br/> output-xml = No <br/> quote-ampersand = No <br/> quote-marks = No <br/> quote-nbsp = No <br/> repeated-attributes = Keep-last <br/> replace-color = No <br/> show-body-only = No <br/> uppercase-attributes = No <br/> uppercase-tags = No <br/> word-2000 = No <br/> show-errors = 6 <br /> show-warnings = Yes <br/> indent = auto <br/> indent-attributes = No <br/> indent-spaces = 2 <br/> literal-attributes = no <br/> markup = Yes <br/> tab-size = 4 <br/> wrap = 100 <br/> wrap-Asp = Yes <br/> wrap-attributes = No <br/> wrap-jste = Yes <br/> wrap-PHP = Yes <br/> wrap-script-literals = No <br/> wrap-sections = Yes <br/> ascii-chars = No <br/> char-encoding = raw <br/> input-encoding = <br/> Language = <br/> output-bom = auto <br/> output-encoding = <br/> newline = <br/> fix-backslash = Yes <br/> force-output = No <br/> GNU-Emacs = No <br/> quiet = No <br/> keep-time = Yes <br/> write-back = Yes <br/> tidy-mark = No <br/> default = 0


Some of the following descriptions

Add-XML-Decl = No
Add-XML-Space = No
Alt-TEXT =
Assume-XML-procins = No
Bare = No
Break-before-Br = No
Clean = No
Doctype = auto
Drop-empty-paras = Yes
Drop-font-tags = No
Drop-proprietary-attributes = No
Enclose-block-TEXT = Yes
Enclose-TEXT = Yes
Escape-CDATA = No
Fix-bad-Comments = Yes
Fix-uri = Yes

Hide-Comments = No
Hide-endtags = No
Indent-CDATA = No
Input-xml = No
Join-classes = No
Join-styles = Yes
Logical-emphasis = Yes

Lower-literals = Yes
NCR = Yes
New-blocklevel-tags =
New-empty-tags =
New-inline-tags =
New-Pre-tags =
Numeric-entities = No
Output-XHTML = No
Output-xml = No
Quote-ampersand = No
Quote-marks = No
Quote-nbsp = No
Repeated-attributes = Keep-last
Replace-color = No
Show-body-only = No
Uppercase-attributes = No
Uppercase-tags = No
Word-2000 = No
Show-errors = 6
Show-warnings = Yes
Indent = auto
Indent-attributes = No
Indent-spaces = 2
Literal-attributes = No
Markup = Yes
Tab-size = 4
Wrap = 100
Wrap-Asp = Yes
Wrap-attributes = No
Wrap-jste = Yes
Wrap-PHP = Yes
Wrap-script-literals = No
Wrap-sections = Yes
ASCII-chars = No
Char-encoding = raw
Input-encoding =
Language =
Output-bom = auto
Output-encoding =
Newline =
Fix-backslash = Yes
Force-output = No
GNU-Emacs = No
Quiet = No
Keep-time = Yes
Write-back = Yes
Tidy-mark = No
Default = 0




Next, paste a default configuration list. Find the specific meaning on Google. Many

HTML tidy configuration options

Pretty print
Character encoding

HTML, XHTML, XML options Top
Option Type Default
Add-XML-Decl Boolean No
Add-XML-pi Boolean No
Add-XML-space Boolean No
Alt-Text String  
Assume-XML-procins Boolean No
Bare Boolean No
Break-before-Br Boolean No
Clean Boolean No
Doctype Doctype Auto
Drop-empty-paras Boolean Yes
Drop-font-tags Boolean No
Drop-proprietary-attributes Boolean No
Enclose-block-Text Boolean No
Enclose-Text Boolean No
Escape-CDATA Boolean No
Fix-bad-Comments Boolean Yes
Fix-Uri Boolean Yes
Hide-Comments Boolean No
Hide-endtags Boolean No
Indent-CDATA Boolean No
Input-XML Boolean No
Join-classes Boolean No
Join-Styles Boolean Yes
Logical-emphasis Boolean No
Lower-literals Boolean Yes
NCR Boolean Yes
New-blocklevel-tags Tag names  
New-empty-tags Tag names  
New-inline-tags Tag names  
New-Pre-tags Tag names  
Numeric-entities Boolean No
Output-XHTML Boolean No
Output-XML Boolean No
Quote-ampersand Boolean Yes
Quote-marks Boolean No
Quote-nbsp Boolean Yes
Repeated-attributes - Keep-last
Replace-color Boolean No
Show-body-only Boolean No
Slide-style Name  
Split Boolean No
Uppercase-attributes Boolean No
Uppercase-tags Boolean No
Word-2000 Boolean No
Diagnostics options Top
Option Type Default
Error-File String  
Force-Output Boolean No
GNU-Emacs Boolean No
Quiet Boolean No
Show-Errors Integer 6
Show-Warnings Boolean Yes
Tidy-mark Boolean Yes
Pretty Print Options Top
Option Type Default
Indent Autobool No
Indent-attributes Boolean No
Indent-Spaces Integer 2
Literal-attributes Boolean No
Markup Boolean Yes
Tab-size Integer 4
Wrap Integer 68
Wrap-Asp Boolean Yes
Wrap-attributes Boolean No
Wrap-jste Boolean Yes
Wrap-PHP Boolean Yes
Wrap-script-literals Boolean No
Wrap-Sections Boolean Yes
Character encoding options Top
Option Type Default
ASCII-chars Boolean Yes
Char-Encoding Encoding ASCII
Input-Encoding Encoding Latin1
Language Language  
Output-bom Autobool Auto
Output-Encoding Encoding ASCII
Raw Boolean No
Miscellaneous options Top
Option Type Default
Fix-backslash Boolean Yes
Keep-time Boolean Yes
Write-back Boolean No

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: 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.