shikiCodeBlocks: support file preview (#1977)

main
AutumnVN 10 months ago committed by GitHub
parent e4942397dc
commit 920252956f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -42,6 +42,13 @@ export default definePlugin({
match: /codeBlock:\{react\((\i),(\i),(\i)\)\{/,
replace: "$&return $self.renderHighlighter($1,$2,$3);"
}
},
{
find: ".PREVIEW_NUM_LINES",
replacement: {
match: /(?<=function \i\((\i)\)\{)(?=let\{text:\i,language:)/,
replace: "return $self.renderHighlighter({lang:$1.language,content:$1.text});"
}
}
],
start: async () => {

Loading…
Cancel
Save