> Anyway, it was during a digression—actually a digression within a digression— that Gruber talks about code blocks in Markdown and how one of his favorite features is that you don’t have to escape anything in a code block. You can paste source code directly into your Markdown document without any changes, and it will appear as expected in the rendered HTML.
True enough as far as it goes but, if you use that Markdown in some static site generators (SSGs), you may still have to massage it a bit so the SSG output won’t be borked. For a couple of examples:
- In Eleventy and Jekyll (and maybe others), you often have to wrap code blocks in `{% raw %}` and `{% endraw %}`.
- In Hugo, if you're including anything that Go initially “thinks” is real code rather than just a reproduction thereof, you must put comment characters around it: `{{< this >}}` isn't OK, but `{{</* this */>}}` is (and will display in Hugo as the desired `{{< this >}}`).
True enough as far as it goes but, if you use that Markdown in some static site generators (SSGs), you may still have to massage it a bit so the SSG output won’t be borked. For a couple of examples:
- In Eleventy and Jekyll (and maybe others), you often have to wrap code blocks in `{% raw %}` and `{% endraw %}`.
- In Hugo, if you're including anything that Go initially “thinks” is real code rather than just a reproduction thereof, you must put comment characters around it: `{{< this >}}` isn't OK, but `{{</* this */>}}` is (and will display in Hugo as the desired `{{< this >}}`).