Closed
Bug 285888
Opened 19 years ago
Closed 19 years ago
FireFox Eats Double-Quotes!!!
Categories
(Core :: DOM: HTML Parser, defect)
Tracking
()
RESOLVED
INVALID
People
(Reporter: revengist, Unassigned)
Details
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.7.6) Gecko/20050225 Firefox/1.0.1 Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.7.6) Gecko/20050225 Firefox/1.0.1 The problem can be seen by using this example: <option onClick="var d='2';var s='Test Example';var m='\"';setvals(d,s,m)"> Put that in a file and name it test.html Open it with firefox. FireFox will eat the last double quote and put the source as: <option onClick="var d='2';var s='Test Example';var m='\"';setvals(d,s,m)> This is so frustrating. Can someone please tell a temp solution until the actual problem is fixed. Reproducible: Always Steps to Reproduce: 1.Have a piece of a string escaped in between a tag like, onLoad="var t='\"';" 2.Load in FireFox 3.The Last Double-Quote of the onLoad tag, will be eaten. Actual Results: The double-quote was eaten!!! Expected Results: Not eaten the double-quote? why is ff so hungry? :(
Updated•19 years ago
|
Assignee: firefox → parser
Component: General → HTML: Parser
Product: Firefox → Core
QA Contact: general → mrbkap
Version: unspecified → Trunk
Comment 1•19 years ago
|
||
The correct way to escape quotation marks in HTML is to use ". If you are talking about the view-source problem where (wrong) quotes would disappear, this bug has already been fixed in nightly builds (and will be fixed when Firefox 1.1 comes out). Based on the summary, I'm marking this bug a dupe of the view-source problem. Please use " (and not \") to escape quotation marks! *** This bug has been marked as a duplicate of 43267 ***
Status: UNCONFIRMED → RESOLVED
Closed: 19 years ago
Resolution: --- → DUPLICATE
No, ", would create a non-parsed quote that shows up as plaintext on the page. \" would be a regular quote that javascript will turn into ". similar to \n = linebreak \t = tab, well \" = quote firefox seems to be eating the last quote, and screwing up the whole parsing of the page. its a CRITICAL problem :(
Status: RESOLVED → UNCONFIRMED
Resolution: DUPLICATE → ---
Comment 3•19 years ago
|
||
Except your javascript is in an attribute value, which goes through the HTML parser before ever reaching the javascript engine. One of the jobs of the HTML parser is to turn such character entities (in attributes and elsewhere) into their character equivalents. Try, for instance: <a href="#" onclick="3 < 4 ? alert('"') : alert("'")">click</a> Note that if you use an inline <script> tag, entities are *not* expanded, so: <script>3 < 4 ? ...</script> is a syntax error
Status: UNCONFIRMED → RESOLVED
Closed: 19 years ago → 19 years ago
Resolution: --- → INVALID
You need to log in
before you can comment on or make changes to this bug.
Description
•