Skip to content

Commit

Permalink
feat: support v-bind expression with wrapped in quotes
Browse files Browse the repository at this point in the history
  • Loading branch information
johnsoncodehk committed Aug 21, 2021
1 parent 28ae08b commit 787ddaf
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion packages/vscode-vue-languageservice/src/parsers/cssBinds.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,13 @@ export function parse(docText: string, ss: css.Stylesheet) {
const matchs = nodeText.matchAll(reg);
for (const match of matchs) {
if (match.index !== undefined) {
const matchText = match[1];
let matchText = match[1];
if (
matchText.startsWith('"') && matchText.endsWith('"')
|| matchText.startsWith("'") && matchText.endsWith("'")
) {
matchText = matchText.substring(1, matchText.length - 1);
}
const offset = node.offset + match.index + nodeText.substr(match.index).indexOf(matchText);
result.push({ start: offset, end: offset + matchText.length });
}
Expand Down

0 comments on commit 787ddaf

Please sign in to comment.