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

tidy indent+wrap breaks <pre> formatting

From: Lee <ler762@gmail.com>
Date: Fri, 16 Mar 2018 09:18:33 -0400
Message-ID: <CAD8GWsu4KV7KOOAMDU4ANneFQywCs9wdBs_mWCrptXC3Ltds6Q@mail.gmail.com>
To: html-tidy@w3.org
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

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