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

Option to remove BOM from start of file #46

Merged
merged 2 commits into from
Oct 12, 2015
Merged

Option to remove BOM from start of file #46

merged 2 commits into from
Oct 12, 2015

Conversation

danspam
Copy link
Contributor

@danspam danspam commented Aug 26, 2015

Similar to the command line version of handlebarsjs, added the option to remove the BOM character from the template before it is compiled. This stops the  character appearing in the html causing unwanted spaces when your text editor saves the file as UTF8 with Signature or similar.

var hbsfy = require("hbsfy").configure({
  bom: true // or b: true
});

Fixes #18 and includes test.

@danspam
Copy link
Contributor Author

danspam commented Sep 23, 2015

@kirbysayshi you seem to have write access now. Any chance of getting this pr merged?

@kirbysayshi
Copy link
Collaborator

Is there ever a reason to include a BOM? I'm wondering if it's worthwhile to just always test for it and strip it if found, vs an explicit option.

@danspam
Copy link
Contributor Author

danspam commented Oct 11, 2015

I added it as an explicit option as this is how it is done on the handlebars precompiler. However, I am with you on this one.. why would you ever want to keep it?!

@kirbysayshi
Copy link
Collaborator

I'm going to merge this, and remove the optional part of it. I can't imagine ever wanting a BOM, might as well just strip it if found.

kirbysayshi added a commit that referenced this pull request Oct 12, 2015
Option to remove BOM from start of file
@kirbysayshi kirbysayshi merged commit 76bace1 into esamattis:master Oct 12, 2015
kirbysayshi added a commit that referenced this pull request Oct 12, 2015
@kirbysayshi
Copy link
Collaborator

@danspam this is published as v2.4.1! I reworked your change to always strip and used a regex instead of the unprintable character. Thanks for the submission!

@danspam danspam deleted the remove-bom branch October 13, 2015 00:10
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants