Skip to content

Update callbackOnCreateTemplates example to show correct use of escapeForTemplate #1354

@romanklabal

Description

@romanklabal

I have just spent an embarrassing amount of time trying to figure out why my data is not being rendered in my custom template, when they get passed via escapeForTemplate from your example:

${escapeForTemplate(data.label)}

When I checked the escapeForTemplate declaration and the demo on your website, I finally noticed that the function expects the actual string to be the second argument, with the first argument being the allowHTML boolean:

${escapeForTemplate(true, data.label)}

No idea when the first argument was introduced and how this isn't a breaking change if the string has been moved to be the second argument, but I think it's worthy to update the example so it's obvious to all the people using your amazing library for the first time.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions