Closed pun-ky closed 4 years ago
But why you're putting the handlebars markup outside knotx snippet ? nothing stops you rendering it as knotx snippet
mislooking when preparing example snippet ;) / edited.
how about even non-html knotx snippet in a form of template engine like using e.g handlebars comment syntax?
{{!--knotxSnippet(knots="databridge,handlebars" databridge-name="someSearch")--}}
{{#string_equals _response.statusCode "200"}}
<script type="application/json">
{{{_result}}}
</script>
<ul class="items">
{{#each _result.response.docs}}
<li>
<!-- .... -->
</li>
{{/each}}
</ul>
{{/string_equals}}
--}}
this will give ability to inject knotx into partial json, xml and so on...
what is more I am worried about nested e.g Githubissues.
Imagine case related with server side rendering in which I need to have both markup rendered and pure JSON beside of:
and in case of HTL , nested script will be not rendered or will be not HTML compliant markup, but.... if we change knot.x snippet tag to be template tag by default, it will be correct. What is more nested template tags are valid in HTML, so that I am convinced that it just gives more flexibility without a need to configure https://github.com/Cognifide/knotx/blob/master/documentation/src/main/cheatsheet/cheatsheets.adoc#snippetoptions .
I know that it is a breaking change, but maybe it is worth to be considered when releasing next major version.