Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Attribute closes the quotations prematurely #665

Merged
merged 3 commits into from
Oct 30, 2021
Merged

Conversation

dcyriller
Copy link
Member

A fix for #371

I couldn't write to #371, so I'm opening this new PR to fix the failing test. Thanks a lot @kamal for the report and the failing test. It was very helpful!

The Bug

As @kamal wrote in the description:

When an attribute contains newlines, a mutation to a MustacheStatement inside of it will cause printing the AST to prematurely close the quotations, causing invalid markup.

Example,

<div
  class="
    block
    {{if this.foo "bar"}}
  "
>
  hello
</div>

when parsed, mutated and printed will produce

<div
  class=""
    block
    {{if this.foo "bar"}}
  "
>
  hello
</div>

@dcyriller dcyriller added the bug Something isn't working label Oct 30, 2021
@dcyriller dcyriller merged commit 51ca54c into master Oct 30, 2021
@dcyriller dcyriller deleted the attribute-newline branch October 30, 2021 18:37
@dcyriller dcyriller changed the title Fix #371 (attribute closes the quotations prematurely) fix: Attribute closes the quotations prematurely Nov 4, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants