This repository has been archived by the owner on Jun 20, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 15
Additional linespaces added with every format #171
Labels
bug
Something isn't working
Comments
Thanks for reporting :) |
Any news about this? |
Wilhansen
pushed a commit
to Wilhansen/prettier-plugin-liquid
that referenced
this issue
Aug 7, 2023
The issue is due to the plugin treating an HtmlRawNode as preformatted text not to be touched the moment it detects the ` character (for template literals) anywhere in the body. Aside from not formatting the contents, it doesn't strip the leading and trailing newlines resulting in compounding new lines everytime prettier is run against the file. This fixes the compounding line issue in particular but does not fix the contents not being prettified when a ` is detected anywhere in the text.
took a stab in fixing the bug on a surface level ☝️ the bug triggers if the script tag contents contain both liquid tags and the backtick for template literals, in addition to the newline, the backtick also disables prettifying (or at least, indentation) of the block (but that's for another issue). |
I'm also having this issue, every time a script tag contains backticks |
I believe this was fixed in the latest version by Shopify/theme-tools#163 |
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Describe the bug
In some liquid snippets, examples below, the when running prettier, have extra line spaces added every time.
Unformatted source
I've done my best to make this as minimal as possible.
Expected output
No change, or potentially some formatting, but not additional linespaces.
Actual output
Debugging information
Additional context
{% if ... %}
statement.The text was updated successfully, but these errors were encountered: