Jump to content

Problem with cache page displaying correctly


mboensch

Recommended Posts

I am problem with cache page displaying correctly. It is fine in Internet Explorer but not in Firefox. It does not make a difference if Greasemonkey scripts are enabled or not. They are all by the same cacher so I am thinking the problem is related to it some how.

 

Here are the GC numbers of some of the pages that I am having problems with:

 

GC10AFK

GC15M88

GC15Q37

GC15WBH

GC15WED

GC1B8JW

GC1BGG1

GC1BGKG

GC1BGKX

GC1BJMT

GC1BJNB

GC1BJNN

GC1CGXZ

GC1CWYF

GC1CYVZ

GC1D211

GC1D94N

GC1GAGC

GC1GAWH

GC1GAWP

GC1GAWV

 

Description of the problem:

 

The menu on the left side of the screen (getting started, hide & seek a cache, etc) is moved to the bottom. The cache description, additional hints, map, and menu on the right side of the screen (navigation, cache attributes, etc) is missing.

Link to comment

Same thing here, using Firefox 3.5 on Mac OS X. I agree that it probably has something to do with the fact that the hider's name is Arrow--). Looking at the page source, having the -- characters inside the HTML comment <!-- Description Written By: Arrow--) --> seems to trick Firefox into treating a large chunk of the page as an HTML comment.

Link to comment

yes it's indeed caused by his nickname. i didn't know html comments worked like that and i guess Groundspeak didn't/doesn't know either.

 

http://htmlhelp.com/reference/wilbur/misc/comment.html

 

i've always thought that "<!--" would begin a comment and "-->" would end it, but that's apparently not how it works. instead, "<!" begins a "comment declaration" containing zero or more comments, and a single ">" ends the comment declaration. within a comment declaration, a "--" begins a comment and another "--" ends a comment, and more comments may follow.

 

so what happens on those pages is this: the html is supposed to include a comment giving the CO's name:

 

<!-- Description Written By: NICKNAME -->

 

this starts a comment declaration (<!), a comment (--) containing the actual comment, ends the comment (--) and ends the comment declaration (>). however, with this particular nickname, it looks like this:

 

<!-- Description Written By: Arrow--) -->

 

this starts a comment declaration (<!), a comment (--) containing a part of the actual comment, but the double dashes in the nickname ends the comment, leaving the ")" outside of any actual comment, but still within the "comment declaration". now the next double dashes (supposed to end the comment) actually starts another comment, leaving everything up to the next set of double dashes as html comment. only somewhat further down the page (inside of what's supposed to be a link) is another set of double dashes, shortly followed by a closing tag (>), thus finally ending the "comment declaration" here:

 

... other caches <a href="/seek/nearest.aspx?u=Arrow--)" title="Hidden by This User">

 

this is a very subtle and obviously not well-known peculiarity of html comments, therefore a definite bug in the gc.com website code!

Edited by dfx
Link to comment

I was bored so I did a little digging, and found a good explanation of what's going on here.

 

Essentially, Firefox treats two consecutive hyphens as either the opening or closing delimiters for a comment, and expects them to exist in pairs of two between <! and > . In the green text in my post above, the two hyphens in the username Arrow-- are interpreted as a second "comment open delimiter"- essentially, a comment within a comment. Thus, the browser searches for another -- farther down the page, finds one the next time Arrow-- is mentioned, then assumes that the comment should be closed after the next instance of the > character. The problem is made more complicated by the fact that Firefox allows whitespace and other characters between the -- and the > . Take a look at the source code of one of the cache descriptions in question using FF 3.5 and you'll see that a significant portion of the code is displayed in green italicized text... indicating a comment.

 

Is this a bug in Firefox? Technically, no. the browser is interpreting the code correctly. In practice, this incredibly literal interpretation of the html spec creates more harm than good and has apparently led to numerous complaints from web developers. For now I think the only option is for Groundspeak to come up with some sort of workaround for usernames with two hyphens.

Link to comment
this is a very subtle and obviously not well-known peculiarity of html comments, therefore a definite bug in the gc.com website code!
And a bug in IE which incorrectly interprets the HTML comment, ironically resulting in the page being rendered "correctly" there.
Link to comment
this is a very subtle and obviously not well-known peculiarity of html comments, therefore a definite bug in the gc.com website code!
And a bug in IE which incorrectly interprets the HTML comment, ironically resulting in the page being rendered "correctly" there.

no surprise there with IE being buggy, really :P

Link to comment

Wow, that's subtle. No wonder web developers drink a lot and retire early.

 

Easy fix though. Just remove that vestigal Description written by stuff - it's about as useful as the human appendix now - and the problem should go away.

 

Yes, we've seen this and have created a bug for it in the system.

Link to comment
Guest
This topic is now closed to further replies.
×
×
  • Create New...