Curly Braces in Markdown with Jekyll
If you use double curly braces in code blocks in markdown with Jekyll. They just won’t show up.
Enclose the code block in raw
and endraw
tags. Like this:
{% raw % }
some code here
{% endraw % }
Writing the previous line and make it appear correctly in this blog post sent me to a 4-hour bottomless pit of googling. I think it’s not possible to show the raw/endraw code in a code block using the raw/endraw tags. Basically I am trying to show:
open raw tag
some code here
close raw tag
This is mostly used to show code that has double curly braces:
{ {site.baseurl} }/assets/images/
I have also seen some strange behavior when adding a JavaScript code block and using Safari on mobile in Reader view mode. The HTML content is not displayed correctly. I thought that maybe my Jekyll template was broken.
Here are other resources I read:
- Escaping double curly braces
- HTML character encoding
- Show raw tags in post generated by jekyll
- Liquid ‘raw’ Tag and Fenced Code Blocks
- Include Jekyll/Liquid code without rendering it
- raw/endraw throwing warning on Jekyll 3.3.1
- raw endraw tags not being respected
- Raw Doc on Liquid
- Jekyll is escaping an anchor tag on my page
- How to escape curly brace percentage in markdown?
- Issue with Jekyll liquid templates and raw tags
- Jekyll Raw Code Block Syntax