[Privoxy-devel] tidy -indent -wrap can break <pre> formatting

Lee ler762 at gmail.com
Mon Mar 12 20:47:26 UTC 2018


I'm trying to add a FAQ entry and I just can't get the formatting
right.  Turns out the problem is with tidy indent + wrap: short lines
don't get screwed up, long lines are split after <pre> and indented

Anyone have a problem with changing the line in GNUmakefile.in
TIDY       = tidy -modify -indent -wrap 78 --tidy-mark no
to -wrap 120

And a related question - what's your default window size?  I use 132x24
Why limit line lengths to less than 80 characters?


test case:
$ cat doit
#!/bin/sh
cp tidy-stc tidy-stc.html
cat tidy-stc.html
echo " ---------- "
tidy -q -modify -indent -wrap 78 --tidy-mark no tidy-stc.html
echo " ---------- "
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>
 <TABLE
BORDER="0"
BGCOLOR="#E0E0E0"
WIDTH="100%"
><TR
><TD
><PRE class="SCREEN"
>1234567890123456789012345678901234567890123456789
</PRE
></TD
></TR
></TABLE
>
</body></html>
 ----------
line 3 column 2 - Warning: <table> lacks "summary" attribute
 ----------
<!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>
  <table border="0" bgcolor="#E0E0E0" width="100%">
    <tr>
      <td>
        <pre class="SCREEN">1234567890123456789012345678901234567890123456789
</pre>
      </td>
    </tr>
  </table>
</body>
</html>

$

And everything looks good.
Now add another character to the class="SCREEN" line:

$ ./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>
 <TABLE
BORDER="0"
BGCOLOR="#E0E0E0"
WIDTH="100%"
><TR
><TD
><PRE class="SCREEN"
>12345678901234567890123456789012345678901234567890
</PRE
></TD
></TR
></TABLE
>
</body></html>
 ----------
line 3 column 2 - Warning: <table> lacks "summary" attribute
 ----------
<!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>
  <table border="0" bgcolor="#E0E0E0" width="100%">
    <tr>
      <td>
        <pre class="SCREEN">
        12345678901234567890123456789012345678901234567890
</pre>
      </td>
    </tr>
  </table>
</body>
</html>

and the pre-formatted text is indented way too far

Lee


More information about the Privoxy-devel mailing list