mirror of
https://github.com/McShelby/hugo-theme-relearn.git
synced 2024-11-27 01:33:04 +00:00
Render the ```mermaid blocks into graphs
This commit is contained in:
parent
4fc43548b5
commit
16782b2425
1 changed files with 4 additions and 1 deletions
|
@ -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('<div class="mermaid" align="center">' + content + '</div>');
|
||||
});
|
||||
});
|
||||
|
|
Loading…
Reference in a new issue