lynx-dev
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: LYNX-DEV CENTER in PRE


From: Klaus Peter Wegge
Subject: Re: LYNX-DEV CENTER in PRE
Date: Thu, 26 Feb 1998 11:45:33 +0100 (MET)

> address@hidden (Jason F. McBrayer)  wrote:
> 
> >>>>> "KPW" == Klaus Peter Wegge <address@hidden> writes:
> KPW> The following behaviour of lynx (lynx2.7.1 up to ac89,
> KPW> not tested with earlier versions) appears in
> KPW> preformatted Texts.
> 
> Jason> [snip, center inside PRE]
> 
> KPW> Lynx doesn't switch back to preformatted text after
> KPW> leaving CENTER.  text3 and text4 will appear on the
> KPW> same line.  As I know, most of html-commands are
> KPW> allowed in <pre> </pre> and there seems to be no
> KPW> exception for CENTER. Netscape 3.++ handels this
> KPW> correctly.
> 
> Jason> Have you tried writing a minimal sample like you gave
> Jason> above and submitting it to a validator?  My gut
> Jason> feeling is that it is _not_ valid html.  You can put
> Jason> text-level markup like <em> or <strong> inside <PRE>,
> Jason> but not block-level markup like <P> or <div>, IIRC.
It's legal HTML.
> 
> Hmm, I tried that on HP-UX 9.05 with slang.
> 
> % lynx -version
> 
> Lynx Version 2.7.2 (1997)
> Copyrights held by the University of Kansas, CERN, and other contributors.
> Distributed under the GNU General Public License.
> See http://lynx.browser.org/ and the online help for more information.
> 
> % echo '<html><head></head><body><pre><center>Is this in 
> center?</center></pre></body></html>' > center.html

Try:
echo '<html><head></head><body><pre>no center<center>Is this in 
center?</center>no center\
new line</pre></body></html>' > center.html
> % lynx -dump center.html
> 
>                              Is this in center?
Formatting looks like:

No center

                             Is this in center?
 
No center new line


The problem is, lynx doesn't switch back to preformatted mode
after the closing </center> and formates the text in normal mode.
In this example "no center" and "new line" should be on different
lines.

In general, we have to think about side effects.
Even if lynx follows exactly the html-specification, it is nice to
have, but not very helpful.
What we need is something like a -dirty_html flag.
With this flag set, lynx should be able to handel html-Documents,
even if they are syntactically wrong but formatted correctly by
most other browsers. 
What I mean is the missing of </xxx> tags or the wrong boxing
of tags like <x1> <x2> </x1> </x2> etc which appers more and more
in the real WWW, often as result of bad configured HTML-generators.
The <center> in  a <pre> block is another example. And there are more!
In my mind, lynx should be able to handle side effects of HTML,
if they are common in usage in the net and not part of the "true"
HTML-specification. I know, this is not easy, because one has to
decide, which is a "common used" and therefore a quasi standard
construct.

There are obviously different behaviors of the current lynx-dev and
lynx2.7.2 concerning tollerance of bad html.
Can someone explain this please?

Regards

Klaus-Peter

reply via email to

[Prev in Thread] Current Thread [Next in Thread]