File tree 1 file changed +3
-0
lines changed
packages/language-core/lib/plugins
1 file changed +3
-0
lines changed Original file line number Diff line number Diff line change @@ -7,6 +7,7 @@ import { parse } from '../utils/parseSfc';
7
7
8
8
const codeblockReg = / ( ` { 3 , } ) [ \s \S ] + ?\1/ g;
9
9
const inlineCodeblockReg = / ` [ ^ \n ` ] + ?` / g;
10
+ const latexBlockReg = / ( \$ { 2 , } ) [ \s \S ] + ?\1/ g;
10
11
const scriptSetupReg = / \\ \< [ \s \S ] + ?\> \n ? / g;
11
12
const sfcBlockReg = / \< ( s c r i p t | s t y l e ) \b [ \s \S ] * ?\> ( [ \s \S ] * ?) \< \/ \1\> / g;
12
13
const angleBracketReg = / \< \S * \: \S * \> / g;
@@ -39,6 +40,8 @@ const plugin: VueLanguagePlugin = ({ vueCompilerOptions }) => {
39
40
. replace ( codeblockReg , ( match , quotes ) => quotes + ' ' . repeat ( match . length - quotes . length * 2 ) + quotes )
40
41
// inline code block
41
42
. replace ( inlineCodeblockReg , match => `\`${ ' ' . repeat ( match . length - 2 ) } \`` )
43
+ // latex block
44
+ . replace ( latexBlockReg , ( match , quotes ) => quotes + ' ' . repeat ( match . length - quotes . length * 2 ) + quotes )
42
45
// # \<script setup>
43
46
. replace ( scriptSetupReg , match => ' ' . repeat ( match . length ) )
44
47
// <<< https://vitepress.dev/guide/markdown#import-code-snippets
You can’t perform that action at this time.
0 commit comments