diff --git a/CHANGELOG.md b/CHANGELOG.md index 4b2973e..a736369 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,9 @@ ## unreleased +### Bugfix +- [GH-110](https://github.com/zackad/prettier-plugin-twig/issues/90) Fix regression when parsing concatenation expression inside html attribute value + ### Internals - DX: Don't use alias to export print function to make it easier to identify when debugging call stack diff --git a/src/melody/melody-parser/Lexer.js b/src/melody/melody-parser/Lexer.js index 1dd2828..3d798b6 100644 --- a/src/melody/melody-parser/Lexer.js +++ b/src/melody/melody-parser/Lexer.js @@ -578,6 +578,9 @@ export default class Lexer { if (c === "\\" && input.la(1) === start) { input.next(); input.next(); + } else if (c === "{" && input.la(1) === "{") { + // interpolation start + break; } else if (c === start) { break; } else { diff --git a/tests/Element/__snapshots__/attributes.snap.twig b/tests/Element/__snapshots__/attributes.snap.twig index 7c986db..52381fa 100644 --- a/tests/Element/__snapshots__/attributes.snap.twig +++ b/tests/Element/__snapshots__/attributes.snap.twig @@ -1,3 +1,6 @@ +{# https://github.com/zackad/prettier-plugin-twig/issues/110 #} +
+ Link + Link