bug report update
Ken Case
kc at omnigroup.com
Wed Feb 10 14:46:49 PST 1999
> I had previously sent a message to this list reporting a bug with
> newlines in textareas using OmniWeb, but I've now looked a bit
> more at the problem and realize that the problem actually lies
> in the way that hidden parameters are handled by OW.
>
> Specifically, newline characters are lost from text strings that
> are passed as hidden cgi parameters.
This isn't specific to hidden cgi parameters, newlines are stripped
from all tag attribute values.
This was done to be compatible with Netscape 2.0, where one could
say (and many did say) something like:
<a href="http://www.omni
group.com/">
(ignore the indentation) and have the value of that anchor's href be
"http://www.omnigroup.com/" with no whitespace where the newline had
been.
I hated writing the code to strip out those newlines (SGML would
actually have us replace those line breaks with whitespace), but it
sure fixed a lot of web pages in that time frame.
So, I take it you're saying that Netscape 4.0 no longer does this?
> Looks like a bug that should be fixed, but if anyone can suggest
> a good workaround in the interim, please let me know.
The best thing to do would be to encode those newlines as character
entities: according to HTML 4.0
(http://www.w3.org/TR/REC-html40/types.html#type-cdata,
User agents should interpret attribute values as follows:
- Replace character entities with characters,
- Ignore line feeds,
- Replace each carriage return or tab with a single space.
line breaks should be interpreted as a single space.
(These rules are actually part of the SGML specification, ISO 8879
section 7.9.3.)
Since you actually want the line breaks in your attribute value to
be preserved, not replaced with spaces, you should encode them as the
carriage return character entity, " ".
Hope this helps!
Ken
More information about the OmniWeb-l
mailing list