How to display {% raw %} and {% endraw %} using markdown?

Viewed 4524

We know {% raw %} and {% endraw %} could be used to escape other characters like double curly braces {{

But how to display {% raw %} and {% endraw %} using markdown?

2 Answers

Put the first {% inside a raw tag, so escaping it avoids the rest being processed:

 {% raw %}{%{% endraw %} raw %}
 {% raw %}{%{% endraw %} endraw %}

Or if you prefer you can escape both:

 {% raw %}{%{% endraw %} raw {% raw %}%}{% endraw %}
 {% raw %}{%{% endraw %} endraw {% raw %}%}{% endraw %}

Both alternatives produces {% raw %} {% endraw %}

Use {% raw %} and {% endraw %} just to escape the characters {% and %} so that Jekyll knows not to process these, and write the words raw and endraw as regular words...

Something like:

{% raw %}{%{% endraw %} raw {% raw %}%}{% endraw %}
{% raw %}{%{% endraw %} endraw {% raw %}%}{% endraw %}

Should output:

{% raw %} {% endraw %}

Related