Skip to content

Commit

Permalink
fix: cannot detect lang when use the sfc compiler of vue2 (#61)
Browse files Browse the repository at this point in the history
  • Loading branch information
kazupon committed Nov 12, 2021
1 parent 1d6676a commit 06fe9ad
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,11 @@ export function getSFCContentInfo(
contentPath: target
}
} else {
return { content: block.content, lang: undefined, contentPath: filepath }
return {
content: block.content,
lang: block.attrs.lang ? block.attrs.lang.toString() : undefined,
contentPath: filepath
}
}
}

Expand Down

0 comments on commit 06fe9ad

Please sign in to comment.