Closed Bug 223838 Opened 21 years ago Closed 21 years ago

The parser grabs 'entities' that don't have semicolons at the end.

Categories

(Core :: DOM: HTML Parser, defect)

x86
Linux
defect
Not set
normal

Tracking

()

VERIFIED INVALID

People

(Reporter: a_different_name, Unassigned)

Details

User-Agent:       Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.2.1) Gecko/20030225
Build Identifier: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.2.1) Gecko/20030225

If i read the standards correctly, an entity is only an entity if there is an &,
a short bunch of characters, and a ; at the end.  However, when viewing a
variable-dump from one of my php scripts, i noticed some characters that didn't
quite make sense as data types.  :)  It turns out that mozilla was treating
'&int' (the ampersand, followed by 'int', in case y'all see this in html) as, i
assume, an integral sign.
I tried including the doctype line, just to make sure it wasn't a 'feature' of
quirks mode, but the problem persists.

Reproducible: Always

Steps to Reproduce:
1.  Create and save a file containing '&int &amp &quot &apos'.  My test file is
pasted in 'additional information'.

2.  Click mozilla over to the page.  Note what gets displayed.
Actual Results:  
 ∫ & " '

Expected Results:  
&int &amp &quot &apos

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">
<html><body> &int &amp &quot &apos </body></html>
> If i read the standards correctly, an entity is only an entity if there is an &,
> a short bunch of characters, and a ; at the end.

You didn't read them correctly.  ;)  See the second note at
http://www.w3.org/TR/html401/charset.html#entities
Status: UNCONFIRMED → RESOLVED
Closed: 21 years ago
Resolution: --- → INVALID
Yep. Note that we used to be much stricter, but some many websites are broken
(b/c IE does it differently), so we had to change, and allow entities without
semicolons. But only when it's safe ofcourse (whitespace is a delimiter here).
Status: RESOLVED → VERIFIED
You need to log in before you can comment on or make changes to this bug.