fix: code block renderer (#284)

* fix: code block renderer
* chore: update dependencies
This commit is contained in:
Libin YANG 2024-04-10 09:25:55 +08:00 committed by GitHub
parent 102c4a6038
commit 2c27ccbc1d
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 17772 additions and 3648 deletions

View File

@ -1,5 +1,5 @@
{
"editor.codeActionsOnSave": {
"source.fixAll": true
"source.fixAll": "explicit"
}
}

21415
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@ -133,10 +133,9 @@ class WxRenderer {
}, 0);
return `<center><pre class="mermaid">${text}</pre></center>`;
}
lang = lang.split(" ")[0];
lang = hljs.getLanguage(lang) ? lang : "plaintext";
text = hljs.highlight(text, { language: lang }).value;
text = text
.replace(/\r\n/g, "<br/>")
.replace(/\n/g, "<br/>")