JacksonTian / ejs-mate

Express 4.x layout, partial template functions for the EJS template engine.
205 stars 36 forks source link

Block #9

Closed tiagom101 closed 9 years ago

tiagom101 commented 9 years ago

Adding

<%= block('javascripts') %>

To the layout.ejs

And

<% block('footer').append('<script src="/bar.js"></script>') %>

To a page.ejs that extends the layout will add text to the page in the following format:

&lt;script src=&quot;/bar.js&quot;&gt;&lt;/script&gt;

Am I doing something wrong here? Thanks.

strawhatgami commented 9 years ago

@Gank I haven't tested it, but you should use "<%-" instead of "<%=" to avoid the content escape. It seems that one of the two given examples in the readme is wrong, and you choiced to test the wrong :-)

JacksonTian commented 9 years ago

use - instead of =