Shopify / prettier-plugin-liquid

Prettier Liquid/HTML plugin
https://npm.im/@shopify/prettier-plugin-liquid
MIT License
93 stars 15 forks source link

Some issues with whitespace management in html attribute parsing #101

Closed charlespwd closed 1 year ago

charlespwd commented 1 year ago

Describe the bug A partner reported some problems with whitespace management in attribute parsing.

EXAMPLE 1 (Defect)

INPUT:    <div id={{ x }}>
OUTPUT:   <div id="" {{ x }}></div>

EXAMPLE 2 (Defect)

INPUT:    <div data-{{ x }}></div>
OUTPUT:   <div data- {{ x }}></div>
charlespwd commented 1 year ago

More context:

LiquidHTMLParsingError Line 34, col 89: expected ">" or "/>"
  32 | {% capture size_chart %}
  33 |   {% if block.settings.info_page != blank %}
> 34 |     <a href="{{ size_page.url }}" class="{{ action_style }}" data-popup-{{ section.id }}="size-{{ section.id }}">
     |                                                                                         ^
  35 |       {{ size_page.title }}
  36 |     </a>