Closed
Description
Hello,
As far as I understand, there is no auto-escape mechanism built into liquidjs. Would it be possible to provide an option that would enable auto-escaping of any output rendered by {{ value }}
?
My use case is that users will write .liquid templates for rendering HTML, JSON, etc. Requiring the users to make sure that every single output is escaped properly (e.g. {{ x | escape}}
for HTML, or {{ x | json}}
for JSON) is tedious and confusing.
Would you be willing to add an option that takes a function which will be applied on every output? (e.g. {autoEscape: (val: any) => any}
)