mirror of
https://github.com/doocs/md.git
synced 2024-11-28 13:36:32 +08:00
fix: code block renderer (#284)
* fix: code block renderer * chore: update dependencies
This commit is contained in:
parent
102c4a6038
commit
2c27ccbc1d
2
.vscode/settings.json
vendored
2
.vscode/settings.json
vendored
@ -1,5 +1,5 @@
|
|||||||
{
|
{
|
||||||
"editor.codeActionsOnSave": {
|
"editor.codeActionsOnSave": {
|
||||||
"source.fixAll": true
|
"source.fixAll": "explicit"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
21415
package-lock.json
generated
21415
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
@ -133,10 +133,9 @@ class WxRenderer {
|
|||||||
}, 0);
|
}, 0);
|
||||||
return `<center><pre class="mermaid">${text}</pre></center>`;
|
return `<center><pre class="mermaid">${text}</pre></center>`;
|
||||||
}
|
}
|
||||||
|
lang = lang.split(" ")[0];
|
||||||
lang = hljs.getLanguage(lang) ? lang : "plaintext";
|
lang = hljs.getLanguage(lang) ? lang : "plaintext";
|
||||||
|
|
||||||
text = hljs.highlight(text, { language: lang }).value;
|
text = hljs.highlight(text, { language: lang }).value;
|
||||||
|
|
||||||
text = text
|
text = text
|
||||||
.replace(/\r\n/g, "<br/>")
|
.replace(/\r\n/g, "<br/>")
|
||||||
.replace(/\n/g, "<br/>")
|
.replace(/\n/g, "<br/>")
|
||||||
|
Loading…
Reference in New Issue
Block a user