Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/textarea-borrowed-closing-tag.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@shopify/prettier-plugin-liquid': patch
---

Fix a stray `>` being printed before a `<textarea>` that directly follows another element.
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,6 @@ export function printElement(

if (shouldPreserveContent(node)) {
return [
printOpeningTagPrefix(node, options),
group(printOpeningTag(path, options, print, attrGroupId), {
id: attrGroupId,
}),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,3 +49,7 @@ printWidth: 30
aaaaaaaaaaaaaaaaaaaaaaaa
</span></a
>

it should not print the borrowed closing tag end marker twice before a textarea
<div><label for="x">Name</label><textarea id="x" rows="4"></textarea></div>
<div><img src="a"><textarea>hi</textarea></div>
Original file line number Diff line number Diff line change
Expand Up @@ -21,3 +21,7 @@ it should borrow the closing span in this situation
printWidth: 30
<a class="link animate-arrow" ><span class="icon-wrap">&nbsp;{% render 'icon-arrow' %}</span></a>
<a class="link animate-arrow" ><span class="icon-wrap">&nbsp; aaaaaaaaaaaaaaaaaaaaaaaa </span></a>

it should not print the borrowed closing tag end marker twice before a textarea
<div><label for="x">Name</label><textarea id="x" rows="4"></textarea></div>
<div><img src="a"><textarea>hi</textarea></div>
Loading