Ticket #5501 (closed defect: fixed)
ComboBox double-escaping HTML entities in inlined data
| Reported by: | guest | Owned by: | bill |
|---|---|---|---|
| Priority: | normal | Milestone: | 1.1 |
| Component: | Dijit | Version: | 1.0 |
| Severity: | normal | Keywords: | |
| Cc: |
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
Note: See
TracTickets for help on using
tickets.