mirror of
https://github.com/McShelby/hugo-theme-relearn
synced 2025-04-30 14:39:04 +08:00
Render the ```mermaid blocks into graphs
This commit is contained in:
parent
4fc43548b5
commit
16782b2425
@ -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…
x
Reference in New Issue
Block a user