Unwanted folding of comments to an element

Hi Everyone,

I think this may a bug in HTML Tidy. I'm using version 5.2.0, but it
has been present for years.

The problem is, I have HTML code like this:

  <ul>
    <li>...</li>
  </ul>
  <!-- ************** -->
  <!--  Some comment  -->
  <!-- ************** -->

HTML Tidy will fold the first comment into the last line before the
comment. For example:

  <ul>
    <li>...</li>
  </ul><!-- ************** -->
  <!--  Some comment  -->
  <!-- ************** -->

It is not just list items. It happens with other elements.

It would be nice if HTML Tidy left comments mostly alone. I like that
Tidy blocks them correctly, but I don't like the first fold that it
performs.

Jeff

Received on Saturday, 26 December 2020 09:04:24 UTC