Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add highlight.js style toggle #112

Merged
merged 21 commits into from
Dec 3, 2021
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
fix not support language for code block
  • Loading branch information
miaogaolin committed Nov 29, 2021
commit 39f48bce573d2533ea193462316ecb500dbf69e6
4 changes: 1 addition & 3 deletions src/assets/scripts/renderers/wx-renderer.js
Original file line number Diff line number Diff line change
Expand Up @@ -120,9 +120,7 @@ class WxRenderer {
return `<blockquote ${getStyles("blockquote")}>${text}</blockquote>`;
};
renderer.code = (text, lang) => {
if (lang == "") {
lang = "text";
}
lang = hljs.getLanguage(lang) ? lang : 'plaintext';

text = hljs.highlight(text, {language: lang}).value;

Expand Down