Closed Bug 89682 Opened 23 years ago Closed 23 years ago

"&lt" without semicolon not translated to less than sign ("<")

Categories

(Core :: DOM: HTML Parser, defect)

x86
Windows NT
defect
Not set
normal

Tracking

()

RESOLVED WORKSFORME

People

(Reporter: mseitz, Assigned: harishd)

References

()

Details

(Keywords: testcase)

Attachments

(1 file)

From Bugzilla Helper:
User-Agent: Mozilla/5.0 (Windows; U; WinNT4.0; en-US; rv:0.9.2+) Gecko/20010706
BuildID:    2001070604

When a page contains "&lt", "&lt" is displayed instead of "<".

Reproducible: Always
Steps to Reproduce:
1. Go to sample URL

Actual Results:  Both the title and body display "&ltfstream>"

Expected Results:  Both the title and body should display "<fstream>"
Sample:
<html>
<head>
<title>How to Use &ltfstream&gt Classes for File I/O</title>

<body> How to Use &ltfstream&gt Classes for File I/O</body>
</html>
Matt, the less than sign should be represented with the characters "&lt;" with a
semicolon.  The problem you describe sounds like it occurs because the semicolon
was dropped.
GD mid-air collision!

here is what I posted...

hmm... weird. Too bad this is a refernce site because...
this is invalid coding because of the missing ";".

Valid less than sign should be &lt;
Valid greater than sign should be &gt;

I have attached a testcase to show how mozilla is parsing this. It seems that
mozilla will parse (add the missing ";") for characters other than alpha or
numbers. This explains why it parses the greater than sign (because nothing
follows) while the less than sign chokes.

--> over to parser for evaluation.

for reference ie5.5 allows for alpha characters after invalid code will chokes
on numbers (see testcase). I suggest wontfix or evangelism because it is bad
code but you never know how many other sites do this too.
Assignee: asa → harishd
Component: Browser-General → Parser
Keywords: testcase
QA Contact: doronr → bsharma
Summary: "&lt" not translated to less than sign ("<") → invalid "&lt" not translated to less than sign ("<")
Keywords: 4xp
This is certainly not 4xp.  4.76 on Linux shows "&ltfstream>" in this case.  In
fact, James' testcase is rendered identically by mozilla build 2001-07-06-08 and
NS 4.76 on Linux.

I too would suggest evangelism.
Keywords: 4xp
Summary: invalid "&lt" not translated to less than sign ("<") → "&lt" without semicolon not translated to less than sign ("<")
I contacted DevX and they have corrected the problem on their page.
thanks matt! :-)

marking WFM because devx fixed their invalid markup.
Status: UNCONFIRMED → RESOLVED
Closed: 23 years ago
Resolution: --- → WORKSFORME
QA Contact: bsharma → moied
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: