Is your feature request related to a problem? Please describe.
We are using liquid templates within text templates that are not HTML (ie, for text email content). When we use the prettier plugin, multiple whitespace and linebreaks get removed.
Describe the solution you'd like
I would love to be able to pass a config option like "textTemplate: true" to make prettier just format the liquid tags and not the text between them.
Describe alternatives you've considered
Have tried looking for other prettier plugins that support liquid but this seems to be the standard one.
Checklist
[x] I have checked and made sure that the proposal adheres to this plugin's principles
I'm not sure if this prettier module is supposed to be specialized for HTML?
Additional context
Here is an example before/after for a template that I'm looking for:
Before:
{% if foo=="bar" %}FOO SPACE{%endif%}
After (current):
{% if foo == "bar" %}FOO SPACE{% endif %}
Desired Output (no removal of the spaces in between FOO and SPACE but the spacing within a liquid tag are correct):
{% if foo == "bar" %}FOO SPACE{% endif %}
Is your feature request related to a problem? Please describe. We are using liquid templates within text templates that are not HTML (ie, for text email content). When we use the prettier plugin, multiple whitespace and linebreaks get removed.
Describe the solution you'd like I would love to be able to pass a config option like "textTemplate: true" to make prettier just format the liquid tags and not the text between them.
Describe alternatives you've considered Have tried looking for other prettier plugins that support liquid but this seems to be the standard one.
Checklist
I believe the extra whitespace is meaningful in text templates. I've read through this link as well: https://github.com/Shopify/prettier-plugin-liquid/blob/main/docs/whitespace-handling.md
I'm not sure if this prettier module is supposed to be specialized for HTML?
Additional context Here is an example before/after for a template that I'm looking for:
Before:
{% if foo=="bar" %}FOO SPACE{%endif%}
After (current):
{% if foo == "bar" %}FOO SPACE{% endif %}
Desired Output (no removal of the spaces in between
FOO
andSPACE
but the spacing within a liquid tag are correct):{% if foo == "bar" %}FOO SPACE{% endif %}