diff options
author | Kostas Chatzikokolakis <kostas@chatzi.org> | 2019-09-12 17:49:16 +0300 |
---|---|---|
committer | Kostas Chatzikokolakis <kostas@chatzi.org> | 2019-09-12 17:49:16 +0300 |
commit | 83a0216daffa630f5702dacc9678309bad5b010b (patch) | |
tree | 3753afc34ffc45396449b9ae19342370498eea54 | |
parent | cd5ca462acdd75e3d3317c13bb469f832ec2f8ea (diff) |
Disable highlight.js for code processed by Hugo's hl
-rw-r--r-- | layouts/partials/reveal-hugo/slides.html | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/layouts/partials/reveal-hugo/slides.html b/layouts/partials/reveal-hugo/slides.html index ac54247..d1157b2 100644 --- a/layouts/partials/reveal-hugo/slides.html +++ b/layouts/partials/reveal-hugo/slides.html @@ -4,6 +4,9 @@ {{- if ne (len .Content) 0 -}} <!-- Remove the <hr /> tag generated by blackfriday for footnotes --> {{- $content := replace .Content "<div class=\"footnotes\">\n\n<hr />" "<div class=\"footnotes\">" -}} + <!-- <code> blocks processed by Hugo's highlighter have a data-lang attribute. For those, we disable --> + <!-- highlight.js by changing the language class to "nohighlight", and adding "data-noescape". --> + {{- $content := replaceRE `<code class="language-\w+"\s+data-lang="\w+"` `<code class="nohighlight" data-noescape` $content -}} <!-- Support both <hr /> (blackfriday) and <hr> (mmark) --> {{- $content := replace $content "<hr>" "<hr />" -}} <!-- Split the processed content by <hr /> tag --> |