Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

newline_to_br filter should output <br /> instead of <br/> #320

Closed
amarsyla opened this issue Mar 11, 2021 · 3 comments
Closed

newline_to_br filter should output <br /> instead of <br/> #320

amarsyla opened this issue Mar 11, 2021 · 3 comments
Labels

Comments

@amarsyla
Copy link

The newline_to_br filter should output <br /> instead of <br/> - https://shopify.github.io/liquid/filters/newline_to_br/

Trying to split a multi-line string will fail in LiquidJS, but will work in Shopify Liquid.

Example usage:

{{ 'a \n b \n c' | newline_to_br | split: '<br />' }}
@amarsyla amarsyla changed the title newline_to_br filter should output <br /> instead of <br/> newline_to_br filter should output <br /> instead of <br/> Mar 11, 2021
@harttle
Copy link
Owner

harttle commented Mar 13, 2021

It seems that the \n should be preserved also.

@harttle
Copy link
Owner

harttle commented Mar 13, 2021

Considering we need to respect the .toString() method when stringify, we can't stringify arrays in the same manner as in Ruby. The output of LiquidJS would be

a ,
 b ,
 c

instead of:

a 
 b 
 c

harttle pushed a commit that referenced this issue Mar 13, 2021
## [9.23.2](v9.23.1...v9.23.2) (2021-03-13)

### Bug Fixes

* comparison for empty/nil, fixes [#321](#321) ([99d14e7](99d14e7))
* newline_to_br filter should output <br /> instead of <br/>, fixes [#320](#320) ([9a9b792](9a9b792))
@harttle
Copy link
Owner

harttle commented Mar 13, 2021

🎉 This issue has been resolved in version 9.23.2 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment