Fix highlighting in code blocks for markdown rendering

pull/1/head
yflory 6 years ago
parent 881976d0ba
commit 3676a6b923

@ -75,11 +75,12 @@ define([
var mediaMap = {}; var mediaMap = {};
var defaultCode = renderer.code;
renderer.code = function (code, language) { renderer.code = function (code, language) {
if (language === 'mermaid' && (code.match(/^sequenceDiagram/) || code.match(/^graph/))) { if (language === 'mermaid' && (code.match(/^sequenceDiagram/) || code.match(/^graph/))) {
return '<pre class="mermaid">'+code+'</pre>'; return '<pre class="mermaid">'+code+'</pre>';
} else { } else {
return '<pre><code>'+code+'</code></pre>'; return defaultCode.apply(renderer, arguments);
} }
}; };

Loading…
Cancel
Save