tidy indent+wrap breaks <pre> formatting

tidy -indent -wrap  breaks <pre> formatting if the line is wrapped

<pre>a long line
</pre>

when indented and wrapped ends up like this
      <pre>
      a long line
</pre>

The pre-formatted text shouldn't have leading spaces added.  It should look like
      <pre>
a long line
</pre>


example:
$tidy --version
HTML Tidy for Cygwin version 5.6.0

$cat doit
#!/bin/sh
cp tidy-stc tidy-stc.html
cat tidy-stc.html
echo " ---------- "
tidy -q -modify -indent -wrap 78 --wrap-attributes yes --tidy-mark no
tidy-stc.html
cat tidy-stc.html


$./doit
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
          "http://www.w3.org/TR/html4/loose.dtd">
<html><head><title>simple test case</title></head><body>
<div><div><div>
<PRE class="SCREEN">x1234567890123456789012345678901234567890123456789
</PRE >
</div></div></div>
</body></html>
 ----------
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
  <title>simple test case</title>
</head>
<body>
  <div>
    <div>
      <div>
        <pre class="SCREEN">
        x1234567890123456789012345678901234567890123456789
</pre>
      </div>
    </div>
  </div>
</body>
</html>

$

Regards,
Lee

Received on Friday, 16 March 2018 17:13:23 UTC