liquid icon indicating copy to clipboard operation
liquid copied to clipboard

Implemented auto-escape functionality and provided a default escape replacer for HTML.

Open dop251 opened this issue 1 year ago • 0 comments

This pull request adds auto-escape functionality which is similar to implicitly applying a filter to the output of an expression block, but done in a slightly efficient way (using a mechanism similar to strings.Replacer which allows for streaming processing without excessive memory allocations).

I know this functionality is not part of liquid (there is an open issue which doesn't have any responses at the time of writing), but I think this is an extremely useful feature and it does not break any existing functionality.

Checklist

  • [x] I have read the contribution guidelines.
  • [x] make test passes.
  • [x] make lint passes.
  • [x] New and changed code is covered by tests.
  • [x] Performance improvements include benchmarks.
  • [x] Changes match the documented (not just the implemented) behavior of Shopify.

dop251 avatar Jul 28 '22 12:07 dop251