Beefy Boxes and Bandwidth Generously Provided by pair Networks
laziness, impatience, and hubris

Re^2: Perl Website Fails on tablet

by tobyink (Canon)
on Mar 20, 2012 at 06:12 UTC ( [id://960530]=note: print w/replies, xml ) Need Help??

in reply to Re: Perl Website Fails on tablet
in thread Perl Website Fails on tablet

It is indeed the improperly closed comment. Whether that comment appears in the <head> or <body> in this case does not actually matter one whit. Obviously <link> elements are supposed to be in the <head>, but in practice browsers do not care about them being in the <body>.

The fact that this one does not end with "-->" though is the problem. Effectively, the comment does not end at all!

The original asker claims that it "works fine on PCs and Macs in any browser [he has] tried". I'd suggest that he's probably not tried very many recent ones. Some older browsers will happen to have error correction algorithms built-in that might be able to cope with this page. However, newer ones are all converging on the "One True" HTML parsing algorithm that appears in the HTML5 specification, which treats the page in question as basically one big comment, starting on line 12 and ending on line 105.

Using lwp-request (part of LWP) and html5debug (part of HTML::HTML5::Parser)...

[tai@miranda (pts/3) ~]$ lwp-request | html5debug --output=err
sniffing:chardet [complicance: INFO; line: 1; column: 1]
not HTML5 [complicance: MUST; line: 4; column: 0]
charset label:matching [complicance: INFO; line: 9; column: 0]
unclosed comment [complicance: MUST; line: 105; column: 7]
perl -E'sub Monkey::do{say$_,for@_,do{($monkey=[caller(0)]->[3])=~s{::}{ }and$monkey}}"Monkey say"->Monkey::do'

Replies are listed 'Best First'.
Re^3: Perl Website Fails on tablet
by tonyb48 (Novice) on Mar 25, 2012 at 16:31 UTC

    Lord I am not worthy

    Thank you very much for investing this much effort on solving my problem. I made the change and now it works (as you knew it would)

    I will investigate LWP and html5debug and add them to my library of debug tools

Log In?

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://960530]
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others taking refuge in the Monastery: (7)
As of 2024-05-20 14:51 GMT
Find Nodes?
    Voting Booth?

    No recent polls found