Skip to content

Commit d62f26b

Browse files
hanoiizackad
authored andcommitted
fix: better support twig expressions in attribute values
1 parent e3ca80a commit d62f26b

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

src/melody/melody-parser/Lexer.js

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -561,17 +561,15 @@ export default class Lexer {
561561
matchAttributeValue(pos) {
562562
const input = this.input;
563563
const start = this.state === State.STRING_SINGLE ? "'" : '"';
564-
let c;
565-
if (input.la(0) === "{") {
564+
let c = input.la(0);
565+
const c2 = input.la(1);
566+
if (c === "{" && (c2 === "{" || c2 === "#" || c2 === "%")) {
566567
return this.matchExpressionToken(pos);
567568
}
568569
while ((c = input.la(0)) !== start && c !== EOF) {
569570
if (c === "\\" && input.la(1) === start) {
570571
input.next();
571572
input.next();
572-
} else if (c === "{") {
573-
// interpolation start
574-
break;
575573
} else if (c === start) {
576574
break;
577575
} else {

0 commit comments

Comments
 (0)