#5501 closed defect (fixed)
ComboBox double-escaping HTML entities in inlined data
Reported by: | guest | Owned by: | bill |
---|---|---|---|
Priority: | high | Milestone: | 1.1 |
Component: | Dijit - Form | Version: | 1.0 |
Keywords: | Cc: | ||
Blocked By: | Blocking: |
Description
Items containing HTML entities in a ComboBox? are displayed incorrectly. The ampersand is always converted to "&", even if it is already part of an escape sequence. Example:
<option>Foo & Bar</option> becomes "Foo & Bar"
and
<option>Foo & Bar</option> becomes "Foo &amp; Bar"
Both IE7 and FF2 did this. The innerHTML attribute seems to be the culprit. I changed line 542 of ComboBox?.js from
return { value: node.getAttribute("value"), name: String(node.innerHTML) };
to
return { value: node.getAttribute("value"), name: String(node.innerText||node.textContent) };
and it works correctly. (Is a CLA required for a 1-line fix?)
Change History (4)
comment:1 Changed 13 years ago by
Milestone: | → 1.1 |
---|---|
Owner: | set to bill |
Status: | new → assigned |
Summary: | ComboBox double-escaping HTML entities → ComboBox double-escaping HTML entities in inlined data |
comment:2 Changed 13 years ago by
Resolution: | → fixed |
---|---|
Status: | assigned → closed |
comment:4 Changed 10 years ago by
Component: | Dijit → Dijit - Form |
---|
Note: See
TracTickets for help on using
tickets.
No CLA required for one line fixes; I'll put this into 1.1. (The code has changed but looks like the same problem is still there.)