I'm trying to create a helper that renders the html for a partial block and generates a code example of that partial.
for example this:
<div class="wrapper">
{{> first}}
{{> second}}
</div>
should produce this:
html:
----------
<div class="wrapper">
<div>first</div>
<div>second</div>
</div>
----------
example:
----------
<div class="wrapper">
{{> first}}
{{> second}}
</div>
I can use a {{{{raw}}}}
block helper or \{{{escape}}}}
, this works for the example but not the html. Is there a way to output both without repeating my self in the code like this:
<div class="wrapper">
{{> first}}
{{> second}}
</div>
<div class="wrapper">
\{{> first}}
\{{> second}}
</div>
Is this possible?
If anyone else run into this issue it was solved here.
https://github.com/wycats/handlebars.js/issues/1385