Allan Anderson
Allan Anderson

Reputation: 583

Can't get double curly brackets to display

I have some markdown in Morea which includes an example Jinja2 template. It looks like this:

{% highlight html linenos %}
<!doctype html>
<html>
<body>
    <p> {{ greet }}, {{ place }} </p>
</body>
</html>
{% endhighlight %}

I would like to be able to display the double curly braces, but they get swallowed up, displaying nothing but the paragraph tags and the comma, like this:

<p>  ,   </p>

I followed some advice to use the {% raw %} and {% endraw %} tags around that line, but nothing changes. Seems like a bug. Anyone have any tricks?

Upvotes: 0

Views: 1516

Answers (3)

David Jacquel
David Jacquel

Reputation: 52829

Surround code containing curly braces with the raw tag :

{% highlight html linenos %}
{% raw %}
<!doctype html>
<html>
<body>
    <p> {{ greet }}, {{ place }} </p>
</body>
</html>
{% endraw %}
{% endhighlight %}

Upvotes: 1

Grace Shi
Grace Shi

Reputation: 1

This should work :

```
{% raw %}
<!doctype html>
<html>
<body>
    <p> {{ greet }}, {{ place }} </p>
</body>
</html>
{% endraw %}
```

Upvotes: 0

Philip Johnson
Philip Johnson

Reputation: 1575

Eek. There appears to be some double-escaping going on with the Morea plugin. The only solution I can come up with quickly is to embed a gist with the code containing the offending liquid tag. Here is a sample page illustrating this approach:

enter image description here

I will continue to look into this. Note that to embed gists you'll need to install the jekyll-gist gem and then add the following to your config.yml:

gems: - jekyll-gist

Upvotes: 0

Related Questions