Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

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?

like image 207
Thomas Avatar asked Jan 29 '23 07:01

Thomas


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 %}

like image 177
marcanuy Avatar answered Jan 31 '23 22:01

marcanuy


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 %}

like image 36
C. Augusto Proiete Avatar answered Feb 01 '23 00:02

C. Augusto Proiete