Skip to content
This repository has been archived by the owner on Oct 19, 2023. It is now read-only.

hbsfy returns BOM character at the beginning of templated strings #18

Closed
ashwnacharya opened this issue Mar 12, 2014 · 3 comments
Closed

Comments

@ashwnacharya
Copy link

var template_hbsfy = require('template.hbs');

// tmpl_string is the exact same string contained in template.hbs, read using $.ajax()
var template = Handlebars.compile(tmpl_string);

// obj is some object
var string1 = template_hbsfy(obj);
var string2 = template(obj);

string1 and string2 are different.

string1 contains a BOM character appended to the beginning ot the string. This is interpreted as an empty text element.

@linus-amg
Copy link

any reaction to that? would like to switch to hbsfy ...

@esamattis
Copy link
Owner

Pr welcome. Even with only a broken test.

@kirbysayshi
Copy link
Collaborator

This is now fixed as of v2.4.1! The BOM is always stripped from input.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants