html - Tidy adding too many newlines -


i quite new tidy, , trying format html files. have section looks like:

<table>     <tr><th class="x">some stuff:</th><th class="x"><span class="y">{{qwe}}</span></th></tr>     <tr><th class="x">some more stuff:</th><th class="x">{{rty}}</th></tr>     <tr><th class="x">thing 1 / thing 2 / thing 3:</th><th class="x">{{asd}} / {{fgh}} / {{poi}}</th></tr>     <tr><th class="x">some file name:</th><th class="x"><a href="{{lkj}}" target="_blank">{{mnb}}</a></th></tr> </table> 

i created tidy config file:

vertical-space: no wrap: 0 new-blocklevel-tags: section, header sort-attribute: alpha 

i ran tidy -config ~/tidy-config.txt -m myfile.html on file , section above gets formatted this:

<table>   <tr>     <th class="x">some stuff:</th>      <th class="x"><span class="y">{{qwe}}</span></th>   </tr>    <tr>     <th class="x">some more stuff:</th>      <th class="x">{{rty}}</th>   </tr>    <tr>     <th class="x">thing 1 / thing 2 / thing 3:</th>      <th class="x">{{asd}} / {{fgh}} / {{poi}}</th>   </tr>    <tr>     <th class="x">some file name:</th>      <th class="x"><a href="{{lkj}}" target="_blank">{{mnb}}</a></th>   </tr> </table> 

i each <th> tag got split on separate lines don't newlines. overall, looks worse original me because it's sparse! there way have more compact pretty print? or set tags newline after closed? dug through config options not find useful.

edit:

i'd like:

<table>   <tr>     <th class="x">some stuff:</th>     <th class="x"><span class="y">{{qwe}}</span></th>   </tr>   <tr>     <th class="x">some more stuff:</th>     <th class="x">{{rty}}</th>   </tr>   <tr>     <th class="x">thing 1 / thing 2 / thing 3:</th>     <th class="x">{{asd}} / {{fgh}} / {{poi}}</th>   </tr>   <tr>     <th class="x">some file name:</th>     <th class="x"><a href="{{lkj}}" target="_blank">{{mnb}}</a></th>   </tr> </table> 

by means, if can suggest different tool use, please do.

setting indent true

indent: true indent-spaces: 2 vertical-space: no wrap: 0 new-blocklevel-tags: section, header sort-attributes: alpha 

will give output

<table>   <tr>     <th class="x">       stuff:     </th>     <th class="x">       <span class="y">{{qwe}}</span>     </th>   </tr>   <tr>     <th class="x">       more stuff:     </th>     <th class="x">       {{rty}}     </th>   </tr>   <tr>     <th class="x">       thing 1 / thing 2 / thing 3:     </th>     <th class="x">       {{asd}} / {{fgh}} / {{poi}}     </th>   </tr>   <tr>     <th class="x">       file name:     </th>     <th class="x">       <a href="{{lkj}}" target="_blank">{{mnb}}</a>     </th>   </tr> </table> 

Comments

Popular posts from this blog

apache - PHP Soap issue while content length is larger -

asynchronous - Python asyncio task got bad yield -

javascript - Complete OpenIDConnect auth when requesting via Ajax -