Re: tidy indent+wrap breaks <pre> formatting

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 
[in_697.html](https://github.com/geoffmcl/tidy-test/blob/master/test/input5/in_697.html) 
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 
[in_697-1.html](https://github.com/geoffmcl/tidy-test/blob/master/test/input5/in_697-1.html) 
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 
[in_697-2.html](https://github.com/geoffmcl/tidy-test/blob/master/test/input5/in_697-2.html) 
has 3 long lines, and no indent is added to any of them.

  4. Test 
[in_697-3.html](https://github.com/geoffmcl/tidy-test/blob/master/test/input5/in_697-3.html) 
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 
`100%`...

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 
details...

Regards,
Geoff.

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