Log in Sign up

How to render raw moustache?

Let's say I want to embed some moustache code into a blog post, how do I do that?

If I enter:

<h1>{{ title }}</h1>

The output on the frontend us just:

<h1></h1>

This is because Blot is trying to render the tag. I've tried changing the brackets to the unicode equivalent, but that didn't work. When I used Jekyll, I could wrap the code blocks in {{ raw }} to tell Jekyll not to try and render those elements.

Does mustache have anything similar? I can't find anything in their docs.

2 replies

I asked on the Moustache GitHub repo and got the answer I needed. In case anyone else needs it, here's how you escape Moustache:

{{=<% %>=}} 
    .....MY ESCAPED MOUSTACHE...
 <%={{ }}=%>

Tested and worked fine for me.

Answered a month ago · Improve this answer

Great, please let me know if anything else comes up

Answered a month ago · Improve this answer

Markdown allowed
Question or feedback?
Contact us

Tags

developers 61 questions bug 30 questions templates 21 questions posts 20 questions meta 19 questions metadata 17 questions resolved 16 questions how 12 questions markdown 9 questions tags 9 questions More tags →
Subscribe for changes
RSS Feed of latest questions