Opened 12 years ago
Closed 11 years ago
#11807 closed enhancement (fixed)
[patch] Make HTML fragment check in dojo.place() whitespace-tolerant
Reported by: | Thomas Bachem | Owned by: | Eugene Lazutkin |
---|---|---|---|
Priority: | high | Milestone: | 1.6 |
Component: | HTML | Version: | 1.5 |
Keywords: | Cc: | ||
Blocked By: | Blocking: |
Description
dojo.place() currently determines whether its first argument is a HTML fragment or a DOM ID by just looking if the first character is a "<".
This leads to confusing problems if the string begins with a whitespace character, e.g. " <strong>foo</strong>".
So line 264 in dojo/_base/html.js should be changed from
node = node.charAt(0) == "<" ? d._toDom(node, refNode.ownerDocument) : byId(node);
to
node = /^\s*</.test(node) ? d._toDom(node, refNode.ownerDocument) : byId(node);
to ignore any whitespace characters at the beginning.
Change History (2)
comment:1 Changed 12 years ago by
Milestone: | tbd → 1.6 |
---|---|
Owner: | changed from sjmiles to Eugene Lazutkin |
Status: | new → assigned |
comment:2 Changed 11 years ago by
Resolution: | → fixed |
---|---|
Status: | assigned → closed |
Note: See
TracTickets for help on using
tickets.
(In [23737]) base: better check for a DOM fragment in dojo.place(), thx thomasbachem!, !strict, fixes #11807.