Skip to content

Template containing text "null" causes error if templateSettings has evaluate undefined #411

@bradlord

Description

@bradlord

The following code differs from an example in the documentation only in the content of the template string, but it results in a TypeError.

_.templateSettings = {
  interpolate : /\{\{(.+?)\}\}/g
};

var template = _.template("Hello null {{ name }}!");
template({name : "Mustache"});

A TypeError also occurs if the template string contains the text "undefined", probably due to the lack of templateSettings.escape regex.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions