Skip to content

Improvement: Specify underscore template settings #3

@lagoasoft-lucasschmidt

Description

@lagoasoft-lucasschmidt

Hey, great library.

I had a problem where a project had used underscore _.templateSettings to change the default behavior.

Problem is that in your library you do your templates based on the default settings, so if someone overrides it, it wont work.

A minor improvement would be for this library to specify its template settings directly.

_.template(templateString, [data], [settings])

Just create an obj with the default settings

{
evaluate : /<%([\s\S]+?)%>/g,
interpolate : /<%=([\s\S]+?)%>/g,
escape : /<%-([\s\S]+?)%>/g
}

(I already fixed in my project by using the solution above, to not interfere with your library, but a library shouldnt depend on that to work)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions