shikiCodeBlocks: support file preview (#1977)
This commit is contained in:
parent
e4942397dc
commit
920252956f
1 changed files with 7 additions and 0 deletions
|
@ -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…
Reference in a new issue