Skip to content

Automatic output escaping #500

Closed
@floofnoodlecode

Description

@floofnoodlecode

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})

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions