W3C home > Mailing lists > Public > html-tidy@w3.org > January to March 2018

Re: tidy indent+wrap breaks <pre> formatting

From: Geoff McLane <ubuntu@geoffair.info>
Date: Tue, 20 Mar 2018 21:00:02 +0100
To: html-tidy@w3.org
Message-ID: <f5556d1a-bf19-c344-3af7-1781beba0a93@geoffair.info>
cross-posted from https://github.com/htacg/tidy-html5/issues/697

As stated was **not** happy with the fix in the `issue-697` branch... it 
had too many other consequences...

So went back to the drawing board! Started with `next` again...

Have have now created an `issue-697-1` branch, and this is **looking 
good**! See commit e36df3b for the small diff...

Added 4 test files to my test repo... each should be run with the `-i` 
indent option. The lines are already greater than the default wrap width 
of `68`...

  1. The original test 
now keeps the long line on the same line as the indented `<pre ...>` 
tag. The `class` attribute is wrapped, but this is **not** a problem.

  2. Test 
has the closing `</pre>` on the same line, and this is kept in the 
output. And it has a really really **long** line of words in a `<pre>. . 
.</pre>` and this is kept in the output.

  3. Test 
has 3 long lines, and no indent is added to any of them.

  4. Test 
has a paragraph `<p>` before and after the inline `<pre>` and they are 
all indented correctly.

And the **best** news of all, this `697-1` version of tidy breaks 
**nothing** in the 
[regression](https://github.com/htacg/tidy-html5-tests) tests... passes 

Will continue testing, and will get around to **deleting** the first 
`issue-697` branch, and creating a PR for this new `issue-697-1` branch...

Would ask others to checkout and test this `issue-697-1` branch and 
report... thanks...

But presently think, **hope**, this pretty print **bug** is solved...

Please see https://github.com/htacg/tidy-html5/issues/697 for full 

Received on Tuesday, 20 March 2018 20:00:33 UTC

This archive was generated by hypermail 2.3.1 : Thursday, 26 April 2018 16:48:57 UTC