How to avoid {{in markdown on Octopress?

I use Octopress to create a blog, and I want to post the following code snippet (Mustache JS syntax):

``` <ul id="beers-list"> {{#beers}} <li>{{name}} - {{color}} - {{alcohol}}%</li> {{/beers}} </ul> ``` 

Unfortunately, when rendering, all {{...}} disappear, and on my website I see the following:

 <ul id="beers-list"> <li> - - %</li> </ul> 

I was unable to escape {{ (even with \{{ , {\{ or something like that. Is there a way to avoid these characters?

Thanks.

I'm not sure SO is the best site for this question

+6
source share
1 answer

In connection with another rather similar question (and answer) here , I found a solution. I need to build my block of code using {% raw %} and {% endraw %} :

 {% raw %} ``` <ul id="beers-list"> {{#beers}} <li>{{name}} - {{color}} - {{alcohol}}%</li> {{/beers}} </ul> ``` {% endraw %} 
+19
source

All Articles