mirror of
https://github.com/jaywcjlove/reference.git
synced 2025-06-17 12:41:20 +08:00
fix: fix show number line issue.
This commit is contained in:
@ -48,13 +48,20 @@ export function create(str = '', options = {}) {
|
||||
],
|
||||
filterPlugins: (type, plugins = []) => {
|
||||
if (type === 'rehype') {
|
||||
let rehypePrism = null;
|
||||
const dt = plugins.filter((plug) => {
|
||||
return /(rehypeRaw)/.test(plug.name) ? false : true;
|
||||
if (Array.isArray(plug) && /(rehypePrism)/.test(plug[0].name)) {
|
||||
rehypePrism = plug;
|
||||
}
|
||||
return /(rehypeRaw|rehypePrism)/.test(plug.name) ? false : true;
|
||||
});
|
||||
// 放在 rehypeDocument 前面
|
||||
dt.unshift(rehypeRaw);
|
||||
if (rehypePrism) {
|
||||
dt.unshift(rehypePrism);
|
||||
}
|
||||
dt.unshift(rehypePreviewHTML);
|
||||
return dt;
|
||||
return plugins;
|
||||
}
|
||||
return plugins;
|
||||
},
|
||||
|
Reference in New Issue
Block a user