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

@ -184,7 +184,7 @@
"max-lines": "off", "max-lines": "off",
"max-nested-callbacks": "error", "max-nested-callbacks": "error",
"max-params": ["error", 6], "max-params": ["error", 6],
"max-statements": ["error", 26], "max-statements": ["error", 28],
"max-statements-per-line": "error", "max-statements-per-line": "error",
"multiline-ternary": "off", "multiline-ternary": "off",
"new-cap": "error", "new-cap": "error",

View file

@ -83,6 +83,10 @@ function uniqueFilterForSortedErrors(value, index, array) {
// Lints a single string // Lints a single string
function lintContent(content, config, frontMatter, resultVersion) { 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) // Remove front matter (if present at beginning of content)
var frontMatterLines = 0; var frontMatterLines = 0;
if (frontMatter) { if (frontMatter) {

View file

@ -0,0 +1,4 @@
{
"default": true,
"MD041": true
}

View file

@ -0,0 +1,3 @@
# Header
Text