mirror of
https://github.com/youzan/vant.git
synced 2025-10-21 11:17:41 +00:00
chore: add vant-markdown-loader package
This commit is contained in:
9
packages/vant-markdown-loader/src/highlight.js
Normal file
9
packages/vant-markdown-loader/src/highlight.js
Normal file
@@ -0,0 +1,9 @@
|
||||
const hljs = require('highlight.js');
|
||||
|
||||
module.exports = function highlight(str, lang) {
|
||||
if (lang && hljs.getLanguage(lang)) {
|
||||
return hljs.highlight(lang, str, true).value;
|
||||
}
|
||||
|
||||
return '';
|
||||
};
|
Reference in New Issue
Block a user