Re: Preventing a line break?

On 9/9/18, Harlan Stenn <stenn@nwtime.org> wrote:
> I'm running tidy 5.5.70, and when tidy sees a line like:
>
> <p>Last update: <!-- #BeginDate format:En2m -->11-Sep-2010 05:53<!--
> #EndDate -->
>
> (a single line) it turns it into:
>
> <p>Last update: <!-- #BeginDate format:En2m -->11-Sep-2010 05:53
> <!-- #EndDate -->
>
> which, ordinarily, is a perfectly fine thing to do.
>
> The trick is, the script we have to auto-update the timestamp inside the:
>
>  <!-- #BeginDate format:En2m -->11-Sep-2010 05:53<!-- #EndDate -->
>
> section can't easily handle having the end tag be on a separate line.
>
> Is there a way that I can tell tidy to avoid cleaning up this line?

you can change where the line wraps:
       -wrap <column>, -w <column> (wrap: <column>)
              wrap text at the specified <column>. 0 is assumed if <column>
              is missing. When this option is omitted, the default
              of the configuration option 'wrap' applies.

$ cat x
<!DOCTYPE html>
<html><head><title>foo</title></head>
<body>
<p>Last update: <!-- #BeginDate format:En2m -->11-Sep-2010 05:53<!--
#EndDate -->
</body></html>

$ tidy -q -w 120 --tidy-mark no x
<!DOCTYPE html>
<html>
<head>
<title>foo</title>
</head>
<body>
<p>Last update: <!-- #BeginDate format:En2m -->11-Sep-2010 05:53<!--
#EndDate --></p>
</body>
</html>


Regards,
Lee

Received on Sunday, 9 September 2018 18:51:17 UTC