Closed punund closed 11 years ago
That doesn't sound right to me. Blade also preserves trailing whitespace. :)
And... it also preserves leading whitespace.
span testing
(that's "span", followed by two spaces, followed by "testing") renders to:
<span> testing</span>
Your are right. My bad.
No problem.
Maybe it's unrelated, but how do I put a whitespace between elements:
input(type="text")
input(type="text")
result is
<input type="text"><input type="text">
desired
<input type="text"> <input type="text">
In Bootstrap controls get glued together...
That's an easy one. :)
input(type="text")
|
input(type="text")
Notice that after the pipe character |
, there are two spaces. A bit tricky, but I've gotten used to it.
Well yes, I just thought that maybe it's worthwhile to have a shorthand notation, given that this is quite common, saving the line for just one whitespace:
input+(type="text")
Or whatever looks better. Besides, trailing spaces are already not too easy to notice, let alone to count them. I have to squint, personally.
Hmmm... you have a good point. So, your suggested solution is to follow tag names with a +
to append a trailing space to the element. Is that correct? If so, I must ask... according to the XML spec, can element names contain plus characters? And, are you sure about a plus sign? IMHO, it looks just as strange as the pipe character and two spaces.
I'm open to ideas. Any thoughts on this?
Plus characters can not be in an XML tag. I don't insist on this notation. Maybe >
is a better choice, with cultural reference to HAML, and this certainly cannot be perceived as a part of the name. This may look as strange as the pipe, but it won't take up extra line, and won't make us wonder how many spaces there are after each standalone pipe.
Blade is so great at saving keystrokes, but here it forces 3 symbols and a line feed to denote just one space. I believe that the pipe should introduce some meaningful text, and this just looks like a hack.
Alright. I'll create a separate issue for this.
Er... no I won't. I'll just re-open this one and re-tag it. Thanks!
By the way, >
is what I will use if HAML uses that. Thanks for doing some research on this.
@punund - Thanks for the suggestion! Checkout https://github.com/bminer/node-blade#whitespace-between-tags
:clap:
I find it very difficult to insert trailing whitespaces into element's content:
I would like it to render as
Trailing spaces are, however, get truncated. Jade, on the other hand, preserves them.