{"id":3174,"date":"2016-02-21T22:01:23","date_gmt":"2016-02-21T22:01:23","guid":{"rendered":"http:\/\/www.garysieling.com\/blog\/?p=3174"},"modified":"2016-02-21T22:01:23","modified_gmt":"2016-02-21T22:01:23","slug":"how-to-escape-code-blocks-in-jekyll","status":"publish","type":"post","link":"https:\/\/www.garysieling.com\/blog\/how-to-escape-code-blocks-in-jekyll\/","title":{"rendered":"How to escape code blocks in Jekyll"},"content":{"rendered":"<p>If you paste code into highlightjs blocks in Jekyll templates, you can get errors like this:<\/p>\n<pre>\nError: Liquid syntax error: \nVariable '{{{ * val mybreaks = new Breaks * \nimport mybreaks.{break, breakable}' \nwas not properly terminated with regexp: \/\\}\\}\/\n\nError: Run jekyll build --trace for more information.\nRegenerating: 1 file(s) changed at 2016-02-21 16:29:07   \n\nLiquid Exception: Liquid syntax error: \n\nVariable '{{{ * val mybreaks = \nnew Breaks * import mybreaks.{break, breakable}' \nwas not properly terminated with regexp: \/\\}\\}\/ \nin \/Users\/gary\/scaladoc-jekyll\/_posts\/2016-02-15-\nscala__util_control_Breaks_TryBlock.md\n...error:\n<\/pre>\n<p>The way to fix this is to use the &#8220;raw&#8221; tag:<\/p>\n<pre>\n{% highlight scala %}\n{% raw %}\nif (x) {\n}\n{% endraw %}\n{% endhighlight %}\n<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>If you paste code into highlightjs blocks in Jekyll templates, you can get errors like this: Error: Liquid syntax error: Variable &#8216;{{{ * val mybreaks = new Breaks * import mybreaks.{break, breakable}&#8217; was not properly terminated with regexp: \/\\}\\}\/ Error: Run jekyll build &#8211;trace for more information. Regenerating: 1 file(s) changed at 2016-02-21 16:29:07 Liquid &hellip; <\/p>\n<p class=\"link-more\"><a href=\"https:\/\/www.garysieling.com\/blog\/how-to-escape-code-blocks-in-jekyll\/\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;How to escape code blocks in Jekyll&#8221;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"om_disable_all_campaigns":false,"_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"footnotes":""},"categories":[4],"tags":[271,307],"aioseo_notices":[],"amp_enabled":true,"_links":{"self":[{"href":"https:\/\/www.garysieling.com\/blog\/wp-json\/wp\/v2\/posts\/3174"}],"collection":[{"href":"https:\/\/www.garysieling.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.garysieling.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.garysieling.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.garysieling.com\/blog\/wp-json\/wp\/v2\/comments?post=3174"}],"version-history":[{"count":0,"href":"https:\/\/www.garysieling.com\/blog\/wp-json\/wp\/v2\/posts\/3174\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.garysieling.com\/blog\/wp-json\/wp\/v2\/media?parent=3174"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.garysieling.com\/blog\/wp-json\/wp\/v2\/categories?post=3174"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.garysieling.com\/blog\/wp-json\/wp\/v2\/tags?post=3174"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}