Trouble with an apostrophe

Ken Case kc
Sun Jun 15 11:42:41 PDT 1997


> I've run into a document that gives my version of OmniWeb some trouble.
> [...]  Near the beginning of the source is a long commented portion

The problem here is that the "comment" isn't, in fact, a comment.  To put  
comments into HTML, the correct syntax is

	<!-- comment comment blah blah -->

and if they had used this syntax, there would be no problem.

As it is, OmniWeb is simply seeing an unrecognized HTML tag.  Unrecognized  
tags are ignored per the HTML spec, but they still have to conform to valid  
syntax for tags (since we have to know how much to ignore).

The apostrophes in the "comment" text are being interpreted as open- and  
close-quotes, and since there are three of them the parser opens a quoted  
string, closes it, opens a new one, and continues scanning past the end of  
the "comment" looking for the end of its new quoted string.  Eventually it  
finds a close quote (another apostrophe) in the alternate text of the image  
tag--but then it sees what would have been an end-quote for the alternate  
text, and thinks it's an open quote.  It closes on the next open-quote, opens  
on the next close-quote, and remains off by one through the rest of the  
page, quoting all the markup and content as just more mysterious portions of  
the unrecognized tag.

Eventually it runs across an unmatched apostrophe, in the last line of  
content.  It continues to scan for the end of the unknown tag (finally  
closing the tag when it sees the next ">" in "</font>"), and then would  
finally begin to render any remaining content--except, of course, there isn't  
any.

I guess we need to offer a new Netscape compatibility preference, since  
presumably this page (and others like it) work fine in Netscape (or they  
would have been fixed long since).

				Ken


More information about the OmniWeb-l mailing list