I'm using hexo.io 3.0.0 which uses nunjuck 1.1.0
How can you escape brackets inside code tags?
Eg:<pre><code class="html"><div>{{ presentation.get("title") }}</div></code></pre>
So that I don't get the following error:
Template render error: Error: Unable to callpresentation["get"], which is undefined or falsey
at Object.callWrap (/../node_modules/hexo/node_modules/nunjucks/src/runtime.js:221:15)
You can use the raw tag and anything inside them will be rendered as they are. {% raw %}{{ anything here }{} {} {% endraw %}
thanks @jlongster. I think it would be a good idea to treat <code> as a {% raw %} tag. What do you think?
@gaboesquivel nunjucks is unaware of the HTML, it only handles tags specific to nunjucks, ie {{ output_tags }}, {% logic_tags %} and {# comment #}. You can use it for other formats as well, not just HTML.
I see... thanks!
Most helpful comment
You can use the
rawtag and anything inside them will be rendered as they are.{% raw %}{{ anything here }{} {} {% endraw %}