Closed CGTS closed 6 years ago
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>
would 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 needing to repeat myself in the code like:
{{{{raw}}}}
\{{{escape}}}}
<div class="wrapper"> {{> first}} {{> second}} </div> {{{{raw-helper}}}} <div class="wrapper"> {{> first}} {{> second}} </div> {{{{/raw-helper}}}}
Is this possible?
If anyone else runs into this issue it was solved here https://github.com/wycats/handlebars.js/issues/1385
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:
would produce this:
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 needing to repeat myself in the code like:Is this possible?