1. Summary
  2. Files
  3. Support
  4. Report Spam
  5. Create account
  6. Log in

HTML Tidy

From notepad-plus

Jump to: navigation, search
Writing cleaner web pages using TextFX HTML Tidy


HTML Tidy is a tool for reformatting and validating HTML text, including XHTML. It is a widely used tool, found on SourceForge here, and is included in Notepad++ as part of the TextFX plug-in.

As installed, HTML Tidy will not do much - it requires a configuration file to activate it. For Notepad++, create a text file in the folder plugins\NPPTextFX under your Notepad++ installation folder, and name it tidycfg.ini. After creating the file, select TextFX -> TextFX HTML Tidy -> Refresh Menu from TidyCFG.INI. This will load the file in Notepad++. Notepad++ will then show a list of possible actions in the TextFX -> TextFX HTML Tidy menu.

Here's a sample that will give some basic reformatting and validation (code from here):


[TiDy clean Document - wrap]
 bare:no
 clean:no
fix-bad-comments:yes
fix-backslash:yes
indent:yes
indent-attributes:no
indent-spaces:2
char-encoding:raw
replace-color:yes
wrap:80
wrap-asp:yes
wrap-jste:yes
wrap-php:yes
write-back:yes 

[TiDy clean Document - nowrap]
bare:no
clean:no
fix-bad-comments:yes
fix-backslash:yes
indent:yes
indent-attributes:no
indent-spaces:2
char-encoding:raw
replace-color:yes
wrap:0
wrap-asp:no
wrap-jste:no
wrap-php:no
write-back:yes

[TiDy clean Document - nowrap, no indent]
bare:no
clean:no
fix-bad-comments:yes
fix-backslash:yes
indent:no
indent-attributes:no
indent-spaces:2
char-encoding:raw
replace-color:yes
wrap:0
wrap-asp:no
wrap-jste:no
wrap-php:no
write-back:yes

[TiDy clean Microsoft Word 2000 document]
doctype:auto
drop-empty-paras:yes
fix-bad-comments:yes
fix-uri:yes
join-styles:yes
lower-literals:yes          
ncr:yes
quote-ampersand:yes
quote-nbsp:yes
word-2000:yes
markup:yes
wrap-jste:yes
wrap-php:yes
wrap-sections:yes
write-back:yes

[TiDy clean Document - quote]
quote-ampersand:yes
quote-marks:yes
quote-nbsp:yes
write-back:yes

[TiDy upgrade to CSS]
add-xml-decl:no
;add-xml-pi:no
alt-text:Image
break-before-br:no
clean:yes
doctype:auto
drop-empty-paras:no
drop-font-tags:yes
fix-backslash:yes
fix-bad-comments:yes
hide-endtags:no
char-encoding:raw
indent:yes
indent-spaces:2
input-xml:no
markup:yes
quiet:yes
tidy-mark:no
uppercase-attributes:no
uppercase-tags:no
word-2000:yes
wrap:100
wrap-asp:yes
wrap-attributes:yes
wrap-jste:yes
wrap-php:yes
write-back:yes

[TiDy convert to XML]
add-xml-decl:yes
;add-xml-pi:yes
alt-text:Image
break-before-br:no
clean:yes
doctype:AUTO
drop-empty-paras:no
drop-font-tags:yes
fix-bad-comments:yes
hide-endtags:no
char-encoding:raw
indent:yes
indent-spaces:2
input-xml:no
markup:yes
output-xml:yes
quiet:yes
tidy-mark:no
uppercase-attributes:no
uppercase-tags:no
word-2000:no
wrap:100
wrap-asp:yes
wrap-attributes:yes
wrap-jste:yes
wrap-php:yes
write-back:yes

[Tidy convert to XHTML]
add-xml-decl:no
;add-xml-pi:no
alt-text:Image
break-before-br:no
clean:yes
doctype:auto
drop-empty-paras:no
drop-font-tags:yes
error-file:error.log
fix-backslash:yes
fix-bad-comments:yes
hide-endtags:no
char-encoding:raw
indent:yes
indent-spaces:2
input-xml:no
markup:yes
output-xhtml:yes
output-xml:no
quiet:yes
tidy-mark:no
uppercase-attributes:no
uppercase-tags:no
word-2000:no
wrap:100
wrap-asp:yes
wrap-attributes:yes
wrap-jste:yes
wrap-php:yes
write-back:yes

[Tidy: Reindent XML]
input-xml: yes
indent:yes
Personal tools
INVISIBLE