Skip to content

haml: Prettier removes HTML unescaping exclamation marks #1261

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

Closed
denschub opened this issue Jul 24, 2022 · 2 comments · Fixed by ruby-syntax-tree/syntax_tree-haml#22
Closed

Comments

@denschub
Copy link

It appears like the plugin doesn't like the exclamation mark to force-unescape HTML. I tried running it on a large code base, and it broke a lot of templates because it removes all the exclamation marks. While explicitly calling .html_safe is a "workaround", I'm not sure if the reformatting should remove the exclamation marks - after all, that's a very explicit decision a well. :)

Metadata

  • Operating system: macOS
  • Ruby version: latest
  • Node version: latest
  • @prettier/plugin-ruby or prettier gem version: latest
  • syntax_tree version: latest

Input

!= body

Current output

= body

Expected output

!= body
@kddnewton
Copy link
Member

Thanks I'll take a look!

@denschub
Copy link
Author

denschub commented Aug 1, 2022

Thank you! :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants