Remove UTF-8 byte order marker from file/string input.

This commit is contained in:
David Anson 2016-11-01 22:39:19 -07:00
parent dcf0462c22
commit f077e4c393
4 changed files with 12 additions and 1 deletions

View file

@ -83,6 +83,10 @@ function uniqueFilterForSortedErrors(value, index, array) {
// Lints a single string
function lintContent(content, config, frontMatter, resultVersion) {
// Remove UTF-8 byte order marker (if present)
if (content.charCodeAt(0) === 0xfeff) {
content = content.slice(1);
}
// Remove front matter (if present at beginning of content)
var frontMatterLines = 0;
if (frontMatter) {