File tree Expand file tree Collapse file tree 3 files changed +22
-11
lines changed
language-core/lib/plugins
language-service/lib/plugins Expand file tree Collapse file tree 3 files changed +22
-11
lines changed Original file line number Diff line number Diff line change @@ -54,6 +54,7 @@ const plugin: VueLanguagePlugin = () => {
54
54
const sfc = parse ( toString ( codes ) ) ;
55
55
56
56
if ( sfc . descriptor . template ) {
57
+ sfc . descriptor . template . lang = 'md' ;
57
58
transformRange ( sfc . descriptor . template ) ;
58
59
}
59
60
if ( sfc . descriptor . script ) {
Original file line number Diff line number Diff line change @@ -16,7 +16,7 @@ const plugin: VueLanguagePlugin = ({ modules }) => {
16
16
17
17
compileSFCTemplate ( lang , template , options ) {
18
18
19
- if ( lang === 'html' ) {
19
+ if ( lang === 'html' || lang === 'md' ) {
20
20
21
21
const compiler = modules [ '@vue/compiler-dom' ] ;
22
22
Original file line number Diff line number Diff line change @@ -35,16 +35,26 @@ export function create(
35
35
} ,
36
36
} ;
37
37
} ;
38
- const baseServicePlugin = mode === 'pug' ? createPugService : createHtmlService ;
39
- const baseService = baseServicePlugin ( {
40
- getCustomData ( ) {
41
- return [
42
- ...customData ,
43
- ...extraCustomData ,
44
- ] ;
45
- } ,
46
- onDidChangeCustomData,
47
- } ) ;
38
+ const baseService = mode === 'pug'
39
+ ? createPugService ( {
40
+ getCustomData ( ) {
41
+ return [
42
+ ...customData ,
43
+ ...extraCustomData ,
44
+ ] ;
45
+ } ,
46
+ onDidChangeCustomData,
47
+ } )
48
+ : createHtmlService ( {
49
+ documentSelector : [ 'html' , 'markdown' ] ,
50
+ getCustomData ( ) {
51
+ return [
52
+ ...customData ,
53
+ ...extraCustomData ,
54
+ ] ;
55
+ } ,
56
+ onDidChangeCustomData,
57
+ } ) ;
48
58
49
59
return {
50
60
name : `vue-template (${ mode } )` ,
You can’t perform that action at this time.
0 commit comments