From 16782b24255325d58267b244d088ba2794257fcf Mon Sep 17 00:00:00 2001 From: Massimeddu Cireddu Date: Fri, 28 Dec 2018 10:46:09 +0100 Subject: [PATCH] Render the ```mermaid blocks into graphs --- static/js/hugo-learn.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/static/js/hugo-learn.js b/static/js/hugo-learn.js index c95f73aac7..d35e89c2ec 100644 --- a/static/js/hugo-learn.js +++ b/static/js/hugo-learn.js @@ -84,5 +84,8 @@ jQuery(document).ready(function() { e.clearSelection(); $(e.trigger).attr('aria-label', 'Link copied to clipboard!').addClass('tooltipped tooltipped-s'); }); - + $('code.language-mermaid').each(function(index, element) { + var content = $(element).html().replace(/->>/g, '->>').replace(/<<-/g, '<<-').replace(/->/g, '->').replace(/<-/g, '<-').replace(/&/g, '&'); + $(element).parent().replaceWith('
' + content + '
'); + }); });