HTML Tidy new empty line after closing tags

谁说我不能喝 提交于 2019-12-01 03:56:28

问题


When I use Tidy HTML in Coda It's clean but I don't like to have empty line

<ul>
    <li>…</li>
<!-- here -->
    <li>…</li>
</ul>

I try to edit config without success

// config file for Coda PHP Toolkit Tidy FORMAT script
// http://www.chipwreck.de/blog/software/coda-php
//
// documentation is here: http://tidy.sourceforge.net/#docs
// rev 5

anchor-as-name: no
doctype: auto
drop-empty-paras: no
fix-uri: no
literal-attributes: yes
merge-divs: no
merge-spans: no
numeric-entities: no
preserve-entities: yes
quote-ampersand: no
quote-marks: no
show-body-only: no
indent: auto
indent-spaces: 4
tab-size: 4
wrap: 0
wrap-asp: no
wrap-jste: no
wrap-php: no
wrap-sections: no
tidy-mark: no
new-blocklevel-tags: article,aside,command,canvas,dialog,details,figcaption,figure,footer,header,hgroup,menu,nav,section,summary,meter 
new-inline-tags: video,audio,canvas,ruby,rt,rp,time,meter,progress,datalist,keygen,mark,output,source,wbr

// Change these only if you need to debug a problem with Tidy
force-output: yes
quiet: yes
show-warnings: yes

I see that question How do I get HTML Tidy to not put newline before closing tags? but that doesn't help me.

What is the option to activate ?

this config is without empty line but no indent :

// config file for Coda PHP Toolkit Tidy FORMAT script
// http://www.chipwreck.de/blog/software/coda-php
//
// documentation is here: http://tidy.sourceforge.net/#docs
// rev 5

anchor-as-name: no
doctype: auto
drop-empty-paras: no
fix-uri: no
literal-attributes: yes
merge-divs: no
merge-spans: no
numeric-entities: no
preserve-entities: yes
quote-ampersand: no
quote-marks: no
show-body-only: no
indent: no
indent-spaces: 2
tab-size: 2
wrap: 0
wrap-asp: no
wrap-jste: no
wrap-php: no
wrap-sections: no
tidy-mark: no
new-blocklevel-tags: article,aside,command,canvas,dialog,details,figcaption,figure,footer,header,hgroup,menu,nav,section,summary,meter 
new-inline-tags: video,audio,canvas,ruby,rt,rp,time,meter,progress,datalist,keygen,mark,output,source,wbr

// Change these if you need to debug a problem with Tidy
force-output: yes
quiet: yes
show-warnings: yes  

回答1:


After much experimenting, i found the correct setting to not add blank lines:

indent: yes  // Indent for human readability. "yes" because "auto" adds blank lines.



回答2:


I would suggest adding

vertical-space: no

even though this should be the default setting.

Does that solve the problem?



来源:https://stackoverflow.com/questions/12843252/html-tidy-new-empty-line-after-closing-tags

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!