欢迎各位兄弟 发布技术文章

这里的技术是共享的

You are here

我的HTML Tidy 配置

shiping1 的头像

HTML Tidy Configuration Options

 

我们现在的网站大部分都是HTML的,如果希望将它们标准化,手工的一页一页修改非常麻烦。如果有一个工具能自动将HTML转换成符合标准的XHTML就好了。其实在这方面已经有许多商业和免费的工具软件可以使用,这里将要介绍的HTML Tidy 就是一个很基本但很有用的工具,它可以运行在多种平台上,而且是开放源代码的。

 

HTML Tidy 是一个能够HTML文件的错误及整齐的排列代码(即缩排)的软件函式库

HTML Tidy 是由W3CDave Raggett开发,其后成为一个Sourceforge的专案,其源码是使用ANSI C写成,而适用于不同操作系统执行档则可因此而编译而成。而HTML Tidy是根据W3C license(宽松的BSD许可证)授权下发布。

 

修正HTML错误如:

  • 遗漏元素结束标签或错配元素标签
  • 补回遗漏的项目(例如一些元素标签,引号等...)
  • 回报文件是否使用私有的HTML元素或扩展
  • 根据预先设定的风格改变排版
  • 将某些编码的字符转换至HTML字符编码
  • 清理呈现式元素

 

  1. [myFormat]  
  2. add-xml-decl=no  
  3. add-xml-space=no  
  4. alt-text=  
  5. assume-xml-procins=no  
  6. bare=no  
  7. break-before-br=no  
  8. clean=no  
  9. doctype=auto  
  10. drop-empty-paras=yes  
  11. drop-font-tags=yes  
  12. drop-proprietary-attributes=no  
  13. enclose-block-text=yes  
  14. enclose-text=yes  
  15. escape-cdata=no  
  16. fix-bad-comments=yes  
  17. fix-uri=yes  
  18. hide-comments=no  
  19. hide-endtags=no  
  20. indent-cdata=no  
  21. input-xml=no  
  22. join-classes=no  
  23. join-styles=yes  
  24. logical-emphasis=yes  
  25. lower-literals=yes  
  26. ncr=yes  
  27. new-blocklevel-tags=  
  28. new-empty-tags=  
  29. new-inline-tags=  
  30. new-pre-tags=  
  31. numeric-entities=no  
  32. output-xhtml=no  
  33. output-xml=no  
  34. quote-ampersand=no  
  35. quote-marks=no  
  36. quote-nbsp=no  
  37. repeated-attributes=keep-last  
  38. replace-color=no  
  39. show-body-only=no  
  40. uppercase-attributes=no  
  41. uppercase-tags=no  
  42. word-2000=no  
  43. show-errors=6  
  44. show-warnings=yes  
  45. indent=auto  
  46. indent-attributes=no  
  47. indent-spaces=2  
  48. literal-attributes=no  
  49. markup=yes  
  50. tab-size=4  
  51. wrap=100  
  52. wrap-asp=yes  
  53. wrap-attributes=no  
  54. wrap-jste=yes  
  55. wrap-php=yes  
  56. wrap-script-literals=no  
  57. wrap-sections=yes  
  58. ascii-chars=no  
  59. char-encoding=raw  
  60. input-encoding=  
  61. language=  
  62. output-bom=auto  
  63. output-encoding=  
  64. newline=  
  65. fix-backslash=yes  
  66. force-output=no  
  67. gnu-emacs=no  
  68. quiet=no  
  69. keep-time=yes  
  70. write-back=yes  
  71. tidy-mark=no  
  72. default=0  

 

 

下面的一些说明

 [myFormat]
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

 

 

 

下面贴上一张默认配置单,具体意义在google上找吧,很多

HTML Tidy Configuration Options

HTML, XHTML, XML
Diagnostics
Pretty Print
Character Encoding
Miscellaneous
 

HTML, XHTML, XML OptionsTop
OptionTypeDefault
add-xml-declBooleanno
add-xml-piBooleanno
add-xml-spaceBooleanno
alt-textString 
assume-xml-procinsBooleanno
bareBooleanno
break-before-brBooleanno
cleanBooleanno
doctypeDocTypeauto
drop-empty-parasBooleanyes
drop-font-tagsBooleanno
drop-proprietary-attributesBooleanno
enclose-block-textBooleanno
enclose-textBooleanno
escape-cdataBooleanno
fix-bad-commentsBooleanyes
fix-uriBooleanyes
hide-commentsBooleanno
hide-endtagsBooleanno
indent-cdataBooleanno
input-xmlBooleanno
join-classesBooleanno
join-stylesBooleanyes
logical-emphasisBooleanno
lower-literalsBooleanyes
ncrBooleanyes
new-blocklevel-tagsTag names 
new-empty-tagsTag names 
new-inline-tagsTag names 
new-pre-tagsTag names 
numeric-entitiesBooleanno
output-xhtmlBooleanno
output-xmlBooleanno
quote-ampersandBooleanyes
quote-marksBooleanno
quote-nbspBooleanyes
repeated-attributes-keep-last
replace-colorBooleanno
show-body-onlyBooleanno
slide-styleName 
splitBooleanno
uppercase-attributesBooleanno
uppercase-tagsBooleanno
word-2000Booleanno
 
Diagnostics OptionsTop
OptionTypeDefault
error-fileString 
force-outputBooleanno
gnu-emacsBooleanno
quietBooleanno
show-errorsInteger6
show-warningsBooleanyes
tidy-markBooleanyes
 
Pretty Print OptionsTop
OptionTypeDefault
indentAutoBoolno
indent-attributesBooleanno
indent-spacesInteger2
literal-attributesBooleanno
markupBooleanyes
tab-sizeInteger4
wrapInteger68
wrap-aspBooleanyes
wrap-attributesBooleanno
wrap-jsteBooleanyes
wrap-phpBooleanyes
wrap-script-literalsBooleanno
wrap-sectionsBooleanyes
 
Character Encoding OptionsTop
OptionTypeDefault
ascii-charsBooleanyes
char-encodingEncodingascii
input-encodingEncodinglatin1
languageLanguage 
output-bomAutoBoolauto
output-encodingEncodingascii
rawBooleanno
 
Miscellaneous OptionsTop
OptionTypeDefault
fix-backslashBooleanyes
keep-timeBooleanyes
write-backBooleanno

 


普通分类: