Render the ```mermaid blocks into graphs

This commit is contained in:
Massimeddu Cireddu 2018-12-28 10:46:09 +01:00 committed by Matthew Taylor
parent 4fc43548b5
commit 16782b2425

View file

@ -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(/-&gt;&gt;/g, '->>').replace(/&lt;&lt;-/g, '<<-').replace(/-&gt;/g, '->').replace(/&lt;-/g, '<-').replace(/&amp;/g, '&');
$(element).parent().replaceWith('<div class="mermaid" align="center">' + content + '</div>');
});
});