List Info

Thread: RE: Feature request: handle style=white-space: pre




RE: Feature request: handle style=white-space: pre
country flaguser name
United States
2008-05-14 14:46:11
><div style="white-space: pre; font-family:
monospace">
>Some formatted text
>with a smiley <img src="smiley.png"> in
the middle.
></div>
>
>That validates against the HTML4 DTD, but Lynx doesn't
render it correctly.

Thanks for the example, the restrictions on PRE are
annoying.

I think it is a little harsh to say Lynx is not rendering
the DIV 
correctly. Certainly, Lynx is not rendering the DIV as
intended, but 
Lynx is faithfully renders the HTML structure of the
document. If a 
DIV has no internal structure, Lynx has no choice but to
render it as 
regular text.

To give the DIV internal structure, I think you could add
BRs, and 
(if needed) replace spaces with non-breaking spaces (this
seems to be 
the method used by some web source-code pretty-printing
systems). For 
example:

<div style="...">
Some formatted text<br>
with a smiley <img src="smiley.png"> in the
middle.<br>
</div>

The fact that CSS can make un-structured text appear to be 
structured, doesn't mean the text actually has structure.
Adding BRs 
gives structure to the DIV's text, so Lynx can render it as
intended.

Even if/when Lynx supports CSS, I'd argue that you'd still
need to 
structure the text with BRs, because many systems will need
the 
structure to correctly interpret the document (search engine
robots, 
text-to-speech systems, etc.)

On a lighter note, without BRs for structure, a page won't
be able to 
participate in CSS Naked Day: http://naked.dustindiaz.
com/

Cheers - Chuck

---
Example structural replacement of PRE:

<PRE>
some text
    indented text
</PRE>

<DIV>
some&nbsp;text<BR>
&nbsp;&nbsp;&nbsp;indented&nbsp;text<BR&g
t;
</DIV>


_______________________________________________
Lynx-dev mailing list
Lynx-devnongnu.org
htt
p://lists.nongnu.org/mailman/listinfo/lynx-dev

Re: Feature request: handle style=white-space: pre
country flaguser name
United Kingdom
2008-05-17 06:11:52
Chuck Houpt wrote:

> Thanks for the example, the restrictions on PRE are
annoying.
>

I think they have a deep historical background.  Basically
PRE pre-dates 
IMG which pre-dates image replacement (of text).

In the original HTML concept, images would either be first
class 
resources, accessed through A elements, or part of documents
in non-HTML 
formats (HTML was for rich navigation and cataloguing). 
Mosaic added 
IMG as a special link that embeds the image in graphical
browsers, but 
they probably didn't consider allowing it in PRE because
image sizes 
cannot be relied on to correlate with text sizes and they
hadn't thought 
of image replacement.

I think there is still a problem with using IMG in PRE, as
you cannot 
rely on the exact text size, so the pre-formatting can be
broken by an 
image.  (More generally, with image replacement, the user
has the right 
to override your text size and image replacement doesn't
handle that 
well.  I regularly do this on graphical browsers, because
designers 
think unreadably small text is cool.)


-- 
David Woolley
Emails are not formal business letters, whatever businesses
may want.
RFC1855 says there should be an address here, but, in a
world of spam,
that is no longer good advice, as archive address hiding may
not work.


_______________________________________________
Lynx-dev mailing list
Lynx-devnongnu.org
htt
p://lists.nongnu.org/mailman/listinfo/lynx-dev

[1-2]

about | contact  Other archives ( Real Estate discussion Medical topics )