vibe-d / vibe.d

Official vibe.d development
MIT License
1.15k stars 284 forks source link

Diet vs Jade: superfluous spaces. #1041

Open vuaru opened 9 years ago

vuaru commented 9 years ago
p hello
  |world

Results in hello world. According to jade both |world and | world should result in helloworld.

It's a small issue, but together with the lack of inline tags (#964), it means having to resort to writing inline html code, e.g. p <strong>hello</strong>world.

s-ludwig commented 9 years ago

According to jade both |world and | world should result in helloworld.

This is not in line with the Jade online converter (http://jade-lang.com/); both result in hello world. But there is a feature in Diet to remove whitespace outside of a tag (>) and inside of a tag ( <). In this case you'd use the inner variant:

p< hello
    | world

See also http://vibed.org/templates/diet#whitespace-removal

vuaru commented 9 years ago

Well, node.js's gulp-jade (https://www.npmjs.com/package/gulp-jade) does give that output. Perhaps there's some mismatch between their online converter and their node.js package?

And thanks for reminding me of the alligators existence :)

s-ludwig commented 9 years ago

Does that package perhaps output minimized HTML? My plan for supporting HTML minimization always included retaining significant whitespace, but maybe they are taking a simpler route?