Skip to content

Commit

Permalink
fix: code block rendering exception (#273)
Browse files Browse the repository at this point in the history
无名代码块渲染导致渲染失败 fix #272
  • Loading branch information
YangFong authored Feb 21, 2024
1 parent 72cb6da commit 9461585
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/assets/scripts/renderers/wx-renderer.js
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ class WxRenderer {
text = text.replace(/<p.*?>/g, `<p ${getStyles("blockquote_p")}>`);
return `<blockquote ${getStyles("blockquote")}>${text}</blockquote>`;
};
renderer.code = (text, lang) => {
renderer.code = (text, lang = "") => {
if (lang.startsWith("mermaid")) {
setTimeout(() => {
window.mermaid?.run();
Expand Down

0 comments on commit 9461585

Please sign in to comment.