Opened 12 years ago
Closed 7 years ago
#8494 closed defect (fixed)
_Templated: remove whitespace from templates
Reported by: | bill | Owned by: | |
---|---|---|---|
Priority: | high | Milestone: | 2.0 |
Component: | Dijit | Version: | 1.2.3 |
Keywords: | Cc: | ||
Blocked By: | Blocking: |
Description
Possible future enhancement to _Templated is to remove unwanted whitespace from templates. "Unwanted" is more complicated than it sounds, since for a template like
<span> <span>hello</span> <span>world</span> </span>
we presumably want to remove the beginning and ending spaces in the parent <span>, but leave the space between the two child spans.
See https://developer.mozilla.org/En/Whitespace_in_the_DOM for hints on how to remove spaces.
Besides the problem in #8492, white space in templates also causes unwanted spaces to show up in the final widget (maybe this is an IE only problem?), which is why many of our templates currently eliminate unwanted spaces between nodes by rearranging the > characters, like:
<button ><span> ...
I thought there was another ticket open about this, but can't find it.
Change History (3)
comment:1 Changed 12 years ago by
comment:3 Changed 7 years ago by
Milestone: | future → 2.0 |
---|---|
Resolution: | → fixed |
Status: | new → closed |
I added template trimming in delite but then had to scale it back because people complained that sometimes there was trimming when they didn't want it, see https://github.com/ibm-js/delite/issues/107. Anyway, marking this fixed for 2.0.
to remove newlines after a tag and newlines+whitespace before a tag (leaving trailing whitespace after a tag as a workaround to force a text node)