Skip to content

Commit 82e1d92

Browse files
committed
check count of quotes in xpath string literal following entityref
1 parent efc2408 commit 82e1d92

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/xpLexer.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -686,6 +686,11 @@ export class XPathLexer {
686686
const lastCharIsSingleQuote = lastChar === "'";
687687
if (lastChar !== '"' && !lastCharIsSingleQuote && !lastToken.value.endsWith('"') && !lastToken.value.startsWith(''')) {
688688
lastToken['error'] = ErrorType.XPathStringLiteral;
689+
} else if (lastChar === '"' || lastChar === "'" && lastToken.length > 1) {
690+
const mod2Chars = [...lastToken.value].filter(l => l === lastChar).length % 2;
691+
if (mod2Chars === 0) {
692+
lastToken['error'] = ErrorType.XPathStringLiteral;
693+
}
689694
}
690695
} else {
691696
this.checkStringLiteralEnd(lastToken);

0 commit comments

Comments
 (0)