Opened 13 years ago

Closed 8 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:


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>hello</span> <span>world</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 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:

    ><span> ...

I thought there was another ticket open about this, but can't find it.

Change History (3)

comment:1 Changed 13 years ago by Douglas Hays


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)

comment:2 Changed 10 years ago by bill

#14891 is a duplicate of this ticket.

comment:3 Changed 8 years ago by bill

Milestone: future2.0
Resolution: fixed
Status: newclosed

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 Anyway, marking this fixed for 2.0.

Note: See TracTickets for help on using tickets.