machty / emblem.js

Emblem.js - Ember-friendly, indented syntax alternative for Handlebars.js
http://emblemjs.com
MIT License
1.04k stars 81 forks source link

Multiline text runs together inside inline script tags #163

Closed traviswsims closed 5 years ago

traviswsims commented 10 years ago

This code

<script type="text/x-emblem" data-template-name="foo">
p
  ' This
    multiline text
    won't be
    rendered
    correctly.
</script>

should be rendered as:

<p>This multiline text won't be rendered correctly. </p>

Unfortunately, I get this:

<p>Thismultiline textwon't berenderedcorrectly. </p>

As a workaround, I use

<script type="text/x-emblem" data-template-name="foo">
p
  ' This
  ' multiline text
  ' won't be
  ' rendered
  ' correctly.
</script> 

but I don't think this is the expected behavior. Obviously, for simple content like this, I'd just inline the text with the p tag, but I can't for more complex content.

If I'm completely off here, please let me know. Thanks!

jacquescrocker commented 10 years ago

i run into this issue all the time. i stupidly use &nbsp; everywhere as a workaround. is the single quote syntax the correct one here?

jacquescrocker commented 10 years ago

yeah, looks like it. documented here: http://emblemjs.com/syntax/#plain-text

jacquescrocker commented 10 years ago

i agree about this bug though, it'd be nice if single quote block syntax handled this properly