Skip to content

Commit 06fe9ad

Browse files
authored
fix: cannot detect lang when use the sfc compiler of vue2 (#61)
1 parent 1d6676a commit 06fe9ad

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/utils.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,11 @@ export function getSFCContentInfo(
133133
contentPath: target
134134
}
135135
} else {
136-
return { content: block.content, lang: undefined, contentPath: filepath }
136+
return {
137+
content: block.content,
138+
lang: block.attrs.lang ? block.attrs.lang.toString() : undefined,
139+
contentPath: filepath
140+
}
137141
}
138142
}
139143

0 commit comments

Comments
 (0)