RandomEtc/ejs-locals

block('name', 'html') actually returns HTML

Closed this issue · 4 comments

That should not be the case, because it keeps users to use <%- block(…) -%> to remove linefeeds around the call to block() when we simply use <% block(…) %>.

From documentation it seems clear it's an instruction and therefore will return nothing and can safely be called with that kind of brackets ;)

There may be either a fix in documentation (if the behavior is desired and should be kept), or a fix in the behavior. What's your call?

I don't remember if that was deliberate or not. If you fix it and the tests pass I'll happily merge it.

OK on my way then ;)

We not really a bug, but mainly a misunderstanding of EJS-escaping: we cannot slurp newlines on the left, that's it. <%- is meant for unescaping and that's all. What I wanted to achieve (slurp left + right) is just impossible and the best I could do would have been <% block(…) -%>.

Not sure it should be fixed then. Your call again?

My call would be not to worry about it. I've stopped using this library myself (in favor of http://ectjs.com which has more of the features I need).