Add specs: HTML comments round-trip verbatim through capture/split - #162
Open
mmorissette wants to merge 1 commit into
Open
Add specs: HTML comments round-trip verbatim through capture/split#162mmorissette wants to merge 1 commit into
mmorissette wants to merge 1 commit into
Conversation
HTML comments are not Liquid syntax and must pass through the parser,
{% capture %}, and the split filter byte-for-byte. Horizon's
resource-list-carousel relies on this to encode slide arrays as
'<!--@list/split-->'-delimited strings.
Four progressive specs (c=121-124), all validated against reference
liquid: comment survives capture verbatim, split on a comment-shaped
delimiter, the full capture->split round trip, and the realistic
loop-built list with a trailing delimiter.
Ports the storefront integration test removed from shop/world#964845.
Closes shop/issues-merchant-workflows#3882
Assisted-By: devx/e5357c56-2306-4c88-97a2-5a8854545719
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
Follow-up to shop/world#964845 and https://github.com/shop/issues-merchant-workflows/issues/3882: a literal HTML comment used as a
splitdelimiter must round-trip verbatim through{% capture %}. Horizon'sresource-list-carouselbuilds slide arrays with{% capture %}…<!--@list/split-->…{% endcapture %}then| split: '<!--@list/split-->'.What
specs/liquid_ruby/html_comment_round_trip.ymlwith 4 progressive specs (c=121–124, a free run of integer levels), all validated verbatim against reference liquid:captureverbatimspliton a comment-shaped delimiter<!--@list/split-->markers (also pins trailing-empty removal)liquid_rubysuite count 2,097 → 2,101All 4 specs pass against
examples/liquid_ruby.rb;rake prepushfailures are pre-existing on the clean tree (verified via stash) and don't touch the new file.