homepage Welcome to WebmasterWorld Guest from
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Become a Pro Member

Home / Forums Index / Code, Content, and Presentation / HTML
Forum Library, Charter, Moderators: incrediBILL

HTML Forum

IE vs. Firefox ikonboard HTML problem
IE is fine, Firefox marks as Comment

 10:06 pm on Nov 5, 2009 (gmt 0)

A while back I ported an ikonboard forum over to a new server and upgraded the ikonboard software. Mysteriously any old post that contained a quote caused the page to format wrong and text to appear to be "missing". It wasn't really a big deal, and still isn't frankly, but it's been bugging me so I decided to look into. Here's an example forum post in question:

<span id='postcolor'><!--QuoteBegin--username+Nov. 03 2007,14:26--><table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td><b>Quote</b> (username @ Nov. 03 2007,14:26)</td></tr><tr><td id="QUOTE"><!--QuoteEBegin--><font color='#000000'>YES&#33; BY THE END OF THE WEEKEND, UPWARDS OF SEVENTEEN PEOPLE WILL KNOW VAGUELY OF YOUR EXISTENCE&#33;&#33;&#33;&#33;&#33;&#33;</font><!--QuoteEnd--></td></tr></table><!--QuoteEEnd--><br><font color='#000000'>That&#39;s 17 more than know me now :(<br><br>AL.</font> <!--Signature--><br><br>--------------<br><span id='signature'>personal info: mostly pale / often sleepy<br>current velocity: lackadaisical with a hint of dawdling</span><!--E Signature--></span>

In Firefox (I'm using 3.5.4) the actual message is missing from the page and the tables are shifted (due to the missing code). Additionally, in the Firefox Source viewer from "<!--QuoteBegin" to "<br>--------------<br>" is marked as green and commented out. This would seem to obviously be the reason why it's not displaying. However in IE it displays just fine and doesn't appear as a comment.

Once I edit the post and resave it the code changes to:

<span id='postcolor'><font color='#000000'><!--QuoteBegin--username+Nov. 03 2007,14:26--><div><br />(--username @ Nov. 03 2007,14:26)</div><div id="QUOTEHEAD">QUOTE</div><div id="QUOTE"><!--QuoteEBegin-->YES&#33; BY THE END OF THE WEEKEND, UPWARDS OF SEVENTEEN PEOPLE WILL KNOW VAGUELY OF YOUR EXISTENCE&#33;&#33;&#33;&#33;&#33;&#33;<!--QuoteEnd--></div><!--QuoteEEnd--><br>That&#39;s 17 more than know me now :(<br><br>AL.</font> <!--Signature--><br><br>--------------<br><span id='signature'>personal info: mostly pale / often sleepy<br>current velocity: lackadaisical with a hint of dawdling</span><!--E Signature--></span>

This works in both Firefox and IE just fine.

It's impossible from a practical perspective to go back and edit thousands of posts to resave them with the new system, so I was wondering if anybody can "spot the problem" and then I can fix it through some other means. HTML/CSS/SQL/whatever.

Any ideas on why Firefox reads it as a Comment and IE doesn't? Thanks!

[edited by: eelixduppy at 5:07 pm (utc) on Nov. 7, 2009]
[edit reason] disabled graphic smileys [/edit]



 1:10 am on Nov 6, 2009 (gmt 0)

Per the HTML spec [w3.org]:

White space is not permitted between the markup declaration open delimiter("<!") and the comment open delimiter ("--"), but is permitted between the comment close delimiter ("--") and the markup declaration close delimiter (">"). A common error is to include a string of hyphens ("---") within a comment. Authors should avoid putting two or more adjacent hyphens inside comments.

Therefore, I suspect that all of those adjacent hyphens is causing the problem.


 7:43 am on Nov 6, 2009 (gmt 0)

Hmm, interesting. The problem though begins with:

<!--QuoteBegin--username+Nov. 03 2007,14:26-->

It does contain double-hyphens at "--username", but that code is identical in both the broken and fixed versions of the code, so I don't see how that specifically can be the problem.

Why doesn't the "comment" end properly at "14:26-->"?


 9:47 am on Nov 6, 2009 (gmt 0)

Is the browser in quirksmode ? IOW, do you have a full doctype ?

How invalid code (e.g. the -- inside your comment, but the is a bunch more) is handled differs from the mode the browser is in.

I'd suggest validating your code: it'll fix this and more, but for a forum that's not an easy task.


 10:03 pm on Nov 6, 2009 (gmt 0)

This happens for every forum member who uses Firefox and for no forum member that uses IE, so I don't think it's related to the browser mode.

In regards to comments, validating it says:

invalid comment declaration: found name start character outside comment but inside comment declaration

<span id='postcolor'><!--QuoteBegin--username+Nov. 03 2007,14:26--><table

And also:

comment declaration started here

<span id='postcolor'><!--QuoteBegin--username+Nov. 03 2007,14:26--><table

The bolded "u" and ">" are what was highlighted by the validator.

I'll be honest, that doesn't mean a whole lot to me, can anybody interpret?


 11:14 pm on Nov 6, 2009 (gmt 0)

The mode a browser is in (quirks, almost standard, standard [IE8 has a forth]) is determined by the doctype (and IE as usual does things differently). How different browsers interpret faulty code depends on the mode they are in.

Hence what's the doctype in both cases and is there anything in front of it (e.g a xml prologue)

Make it:
<!--QuoteBegin-username+Nov. 03 2007,14:26-->

[Do not add double dashes inside comments]


 11:20 pm on Nov 6, 2009 (gmt 0)

The doctype:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">

Here's the thing with the double dashes, if you look above at my original post you'll see that the "fixed" code that works fine in both IE and Firefox also contains the exact same double dashes. So clearly, while a bad idea, it's not what's causing the problem. Any other ideas?

Global Options:
 top home search open messages active posts  

Home / Forums Index / Code, Content, and Presentation / HTML
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved