Re: html-tidy] Re: Preventing a line break?

On 9/10/2018 9:10 AM, R P Herrold wrote:
> On Sun, 9 Sep 2018, Harlan Stenn wrote:
> 
>> Sorry - that message did get posted last year.
>>
>> I haven't yet figured out a way to deal with the problem, so I'm going
>> to beat on it some more.
>>
>> If anybody has ideas, that would be great.
> 
>> 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.
> 
> 
> What language is the script in question in ?  That is the 
> proper place to fix it of course

Perl, and I've been hacking that script to fix it there if possible.

> Also it seems pretty obvious that the date information is 
> complete
>  <!-- #BeginDate format:En2m -->11-Sep-2010 05:53 <NL>
> 
> at the NL as a termintor, and parsing looking for 
> a terminal NL should suffice

Agreed, and then I found a case where tidy emitted:

... <!-- #BeginDate format:En2m -->11-Sep-2010 05:53<!-- NL
#EndDate -->

(not sure if there was a space <!-- or not).

This tells me that it's *possible* that another output might be:

... <!-- #BeginDate format:En2m -->11-Sep-2010
05:53<!--#EndDate -->

so yeah, the 2 obvious ways to fix this are:

- come up with a proper match to deal with a multi-line (2 lines should
be fine) #BeginDate/#EndDate match, or

- come up with a way to tell tidy to keep this construct on a single line.

It's clear the former is the better choice.  I'm just currently being
impressed at how difficult this is being.  But it's also been a few
years since I've had to write a perlre that addressed a situation like this.

-- 
Harlan Stenn <stenn@nwtime.org>
http://networktimefoundation.org - be a member!

Received on Monday, 10 September 2018 17:52:40 UTC