HTML Tidy new empty line after closing tags

2020-03-23 17:46发布

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  

标签: coda htmltidy
2条回答
Lonely孤独者°
2楼-- · 2020-03-23 18:14

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.
查看更多
\"骚年 ilove
3楼-- · 2020-03-23 18:36

I would suggest adding

vertical-space: no

even though this should be the default setting.

Does that solve the problem?

查看更多
登录 后发表回答