-
8ff89592: Adjust LiquidDoc formatting rules for single-line and multi-line examples and descriptions
- Multi-line content starts on a new line
- Single-line content is kept on the same line or a new line as it was provided
- Updated dependencies [de877551]
- @shopify/[email protected]
- 9563715a: Add padding for liquid doc content
- 357ea7fc: Prevent prettier from appending
@description
annotation before implicit descriptions - Updated dependencies [10493c9d]
- Updated dependencies [79c9f773]
- Updated dependencies [9563715a]
- @shopify/[email protected]
- 085aabbe: Add prettier support for the
@description
tag
- Patch bump because it depends on @shopify/liquid-html-parser
- Updated dependencies [c4bbf3b5]
- Updated dependencies [d9dbc265]
- Updated dependencies [2db3047f]
- Updated dependencies [261c2958]
- @shopify/[email protected]
-
e57979e0: Add parsing and prettier support for example node in liquiddoc Example:
{% doc %} @example Here is my content {% enddoc %}
-
357feaa8: Add formatting support for optional liquidDoc parameters (e.g.
@param [optional-parameter] - paramDescription
). Whitespace is now stripped around the parameter name and the optional delimiters.
- Updated dependencies [e57979e0]
- Updated dependencies [8c9f5bcf]
- @shopify/[email protected]
- 841ca6d1: Update repository URL for all packages to be case sensitive
- Updated dependencies [841ca6d1]
- @shopify/[email protected]
- Patch bump because it depends on @shopify/liquid-html-parser
- Updated dependencies [dd0cd4d2]
- @shopify/[email protected]
- ac55577a: Add prettier support for LiquidDoc {% doc %} tag and @param annotation
- Updated dependencies [ac55577a]
- @shopify/[email protected]
- Patch bump because it depends on @shopify/liquid-html-parser
- Updated dependencies [8912fab8]
- @shopify/[email protected]
- Patch bump because it depends on @shopify/liquid-html-parser
- Updated dependencies [1f54be13]
- @shopify/[email protected]
- Patch bump because it depends on @shopify/liquid-html-parser
- Updated dependencies [c4813ff]
- @shopify/[email protected]
- 568d53b: Add support for the
content_for
Liquid tag
- Updated dependencies [568d53b]
- @shopify/[email protected]
- Patch bump because it depends on @shopify/liquid-html-parser
- Updated dependencies [c664d52]
- @shopify/[email protected]
- Patch bump because it depends on @shopify/liquid-html-parser
- Updated dependencies [1c73710]
- Updated dependencies [d1f9fef]
- Updated dependencies [70e2241]
- @shopify/[email protected]
-
a07a064: Add
captureWhitespaceSensitivity
configuration option.- When
strict
(default), behaves as before: treats the child nodes of{% capture var %}
child nodes as strictly whitespace sensitive, therefore does not reformat contents. - When
ignore
(new), makes it behave like tags that are not whitespace sensitive. Warning: blindly running this will alter the string value of variables captured by the capture tag.
{% # with captureWhitespaceSensitivity: ignore %} {% # input %} {% capture var %} {% for x in y %} {{ x }} {% endfor %} {% endcapture %} {% # output %} {% capture var %} {% for x in y %} {{ x }} {% endfor %} {% endcapture %}
Thank you @stijns96 for this feature!
- When
- 2a3bca1: Fix pretty printing of keys that start with numbers
- 0990c47: Fix config validation problem that required optional settings
- 617b766: Add parser support for trailing commas at the end of Liquid tags and filters
- Updated dependencies [0990c47]
- Updated dependencies [617b766]
- @shopify/[email protected]
- fa02f1b: Fix parsing of
}}
inside{% %}
and vice-versa - Updated dependencies [fa02f1b]
- @shopify/[email protected]
- 8451075:
package.json
and README cleanups - Updated dependencies [8451075]
- @shopify/[email protected]
-
636895f: Allow 'HtmlDanglingMarkerClose' nodes to have non-dangling marker siblings
-
636895f: Add support for unclosed HTML nodes inside branching code
The following code is now supported by the formatter:
{% if cond %} <details> <summary>...</summary> {% endif %}
To follow: a linting rule that warns you if the pairs are unbalanced.
- Updated dependencies [636895f]
- Updated dependencies [636895f]
- @shopify/[email protected]
- Patch bump because it depends on @shopify/liquid-html-parser
- Updated dependencies [78813ea]
- @shopify/[email protected]
- Patch bump because it depends on @shopify/liquid-html-parser
- Updated dependencies [0d71145]
- @shopify/[email protected]
- bec7ee0: Fix idempotence of script tag bodies with both backticks and Liquid in them
- 328ba49: Fix cursorOffset bug with prettier 3
- 25b79f0: Rename LiquidDrop -> LiquidVariableLookup
- f552d4d: Fixup the position of LiquidBranch nodes
- Updated dependencies [02f4731]
- @shopify/[email protected]
- 5479a63: Fix node location bug in {% liquid %}
- 5479a63: Add placeholder support in in tags and attributes
- Fixup mode passing in toLiquidHtmlAst
- Fixup toAttributePosition with array name (empty string)
- Add RAW_TAGS constant in parser/grammar.ts
- Add
|| prettier@^3
peerDependencies
to package.json... - Update README to account for prettier@3 breaking changes
- Add support for
prettier@^3
(in addition toprettier@^2
) (#196) - Add
completion
mode to the parser (#195)
-
Add support for Strict Liquid Markup parsing (#187)
-
Add support for dangling HTML nodes inside Liquid if statements (#186)
That is, the following liquid code no longer throws a LiquidHTMLParsingError
<div> {% if href %} <a href='{{ href }}'> {% endif %} <div class='content-wrapper'> <p>...</p> </div> {% if href %} </a> {% endif %} </div>
The heuristic we're going for is the following:
- Only supported inside a LiquidBranch (if,else,when)
- At most 2 of the same type (2 dangling open, or 2 dangling close)
Everything else still throws a LiquidHTMLParsingError. The idea is that those are likely errors, whereas the heuristic isn't.
- Maintain at most 1 newline between tag attributes (#159)
- Allow for nested HTML raw tags (#157)
- Fix
{% paginate %}
parsing error (#155)
- Add support for sections tag
- Emit declaration files
- Fix trailing whitespace after opening raw tag breaking formatting (#145)
- Add typings for standalone.js
🎉 The Liquid prettier plugin is now officially ready for production!
Astute devs might have noticed that it is also enabled inside Shopify's Online Store Code Editor.
- Stability :)
- No major changes
- Compatible with
v0.4
- Top level unclosed tags should throw errors (#140)
- Change README production notice to production-ready :)
- Maintain at most 1 newline between Liquid branches (#137)
- Parse smart quotes as dumb quotes to prevent formatted copy pasting errors (#130)
- Add support for compound Liquid + HTML element names (#128)
- e.g.
<h{{ header_number}}></h{{ header_number }}>
- e.g.
- Fix parsing of LiquidDrop in HTML attribute names (
<a data-popup--{{ id }}="...">
) (#101) - Fix parsing of unquoted LiquidDrop HTML attributes (
<a id={{ id }}--omg>
) (#101) - Fix parsing of tags with missing space between whitespace stripping and tag name (
{% else-%}
) (#126)
- It's supposed to be stable now :)
- Add support for
prettier-ignore-attributes
(#125)
- Fix secondary templating parsing issue (#125)
- Fix IE conditional comments formatting (#122)
- Fix the formatting of HTML tags with one attribute that is multiline (#121)
- Fix support of legacy HTML doctypes. (#96, #102)
- Fix unnecessary whitespace stripping on liquid html attribute break (#102)
- Fix indentation sensitivity of
{% capture %}
tag. (#114) - Fix
useTabs
bugs (#89, #114) - Add missing support for
{% stylesheet %}
tag (#117) - Add missing support for nested comments (#108)
- Add support for the
{% liquid %}
tag (#94) - Add support for embedded languages (#88)
- Use prettier's JavaScript formatter inside
<script>
and{% javascript %}
tags - Use prettier's CSS formatter inside
<style>
and{% style %}
tags - Use prettier's JSON formatter inside
<script type="anything/that-ends-in-json">
and{% schema %}
tags - Use prettier's Markdown formatter inside
<script type="text/markdown">
- Add a new configuration:
embeddedSingleQuote
to control thesingleQuote
property of embedded languages- When
true
(default), will prefer single quotes inside embedded JS & CSS
- When
- Use prettier's JavaScript formatter inside
- Fix grammar precedence (>=, <=) for operators in conditionals (#98)
- Fixup printing of failed-to-parse Liquid (#95)
- Add online playground (#86)
- Add support for
{% # prettier-ignore %}
(#85) - Add support for the
assign
tag (#54) - Add support for the
echo
liquid tag (#54) - Add support for the
section
tag (#73) - Add support for the
if
,elsif
andunless
tags (#77) - Add support for the
render
andinclude
tags (#56) - Add support for the
form
tag (#75) - Add support for the
capture
open tag parsing (#84) - Add support for the
case
andwhen
tag (#78) - Add support for the
cycle
tag (#81) - Add support for the
for
tag (#79) - Add support for the
increment
anddecrement
tags (#82) - Add support for the
layout
tag (#80) - Add support for the
paginate
tag (#76) - Add support for the
tablerow
tag (#79) - Prefer
null
overnil
- Strip markup from tags that don't take arguments
- Add partial support for Liquid inside YAML frontmatter (#71)
- Adds pretty-printing of Liquid objects and filters (#41 and #46)
- Adds the
liquidSingleQuote
configuration option- Prefer single quotes inside Liquid strings
true
by default
- Add support for Liquid inline comments (
{% # hello world %}
) #28 - Fix support of attribute names to be spec-compliant (e.g. AlpineJS attributes) #27
- Micro refactor of node.isLeadingWhitespaceSensitive && !node.hasLeadingWhitespace
- Add gif to README
- Public access
- Fixup reindent bug
- theme-check compatible defaults
- Initial release