Closed Bug 349775 Opened 18 years ago Closed 18 years ago

javascript document.write converts '&lt' to '&lt'

Categories

(Firefox :: General, defect)

x86
Windows XP
defect
Not set
normal

Tracking

()

RESOLVED INVALID

People

(Reporter: s1, Unassigned)

Details

User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; da; rv:1.8.0.6) Gecko/20060728 Firefox/1.5.0.6 Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 5.1; da; rv:1.8.0.6) Gecko/20060728 Firefox/1.5.0.6 The following code should display as: <test> But displays as: &lttest> Reproducible: Always Steps to Reproduce: <html> <body> <script language="javascript"> document.writeln('&lttest>'); </script> </body> </html>
A character entity reference ends properly with a semicolon, newline, or the start of a tag, and improperly in error recovery with the first character that's not a legal NAME character in HTML (anything but A-Z, a-z, 0-9, or .-_:). That means you can get away with saying &lt?xml because the ? can't be part of an entity name, but you have to use &lt;test rather than &lttest because &lttest might be an entity we don't recognize, rather than the entity named lt and the word test.
Status: UNCONFIRMED → RESOLVED
Closed: 18 years ago
Resolution: --- → INVALID
You need to log in before you can comment on or make changes to this bug.