diff --git a/lib/index.js b/lib/index.js index ff43058e..e73f88b7 100644 --- a/lib/index.js +++ b/lib/index.js @@ -13,6 +13,7 @@ * Dependencies. */ +var decamelize = require('decamelize'); var sort = require('vfile-sort'); var range = require('mdast-range'); var zone = require('mdast-zone'); @@ -172,6 +173,24 @@ function loadExternals(externals) { return rules; } +/** + * Helper to ensure ruleId’s are dash-cased instead of + * camel-cased. + * + * @param {Object} source - Original settings. + * @return {Object} - Dash-cased settings. + */ +function decamelizeSettings(source) { + var result = {}; + var key; + + for (key in source) { + result[decamelize(key, '-')] = source[key]; + } + + return result; +} + /** * Lint attacher. * @@ -190,7 +209,7 @@ function loadExternals(externals) { * rule options. */ function lint(mdast, options) { - var settings = options || {}; + var settings = decamelizeSettings(options || {}); var reset = settings.reset; var rules = loadExternals(settings.external); var id; diff --git a/mdast-lint.js b/mdast-lint.js index d93ad312..039ab46b 100644 --- a/mdast-lint.js +++ b/mdast-lint.js @@ -150,7 +150,7 @@ function attacher() { module.exports = attacher; -},{"mdast-util-position":62,"unist-util-visit":66}],3:[function(require,module,exports){ +},{"mdast-util-position":63,"unist-util-visit":67}],3:[function(require,module,exports){ /** * @author Titus Wormer * @copyright 2015 Titus Wormer @@ -166,6 +166,7 @@ module.exports = attacher; * Dependencies. */ +var decamelize = require('decamelize'); var sort = require('vfile-sort'); var range = require('mdast-range'); var zone = require('mdast-zone'); @@ -325,6 +326,24 @@ function loadExternals(externals) { return rules; } +/** + * Helper to ensure ruleId’s are dash-cased instead of + * camel-cased. + * + * @param {Object} source - Original settings. + * @return {Object} - Dash-cased settings. + */ +function decamelizeSettings(source) { + var result = {}; + var key; + + for (key in source) { + result[decamelize(key, '-')] = source[key]; + } + + return result; +} + /** * Lint attacher. * @@ -343,7 +362,7 @@ function loadExternals(externals) { * rule options. */ function lint(mdast, options) { - var settings = options || {}; + var settings = decamelizeSettings(options || {}); var reset = settings.reset; var rules = loadExternals(settings.external); var id; @@ -505,7 +524,7 @@ function lint(mdast, options) { module.exports = lint; -},{"./filter":2,"./rules":20,"fs":undefined,"mdast-range":60,"mdast-zone":64,"path":undefined,"vfile-sort":67}],4:[function(require,module,exports){ +},{"./filter":2,"./rules":20,"decamelize":60,"fs":undefined,"mdast-range":61,"mdast-zone":65,"path":undefined,"vfile-sort":68}],4:[function(require,module,exports){ /** * @author Titus Wormer * @copyright 2015 Titus Wormer @@ -616,7 +635,7 @@ function blockquoteIndentation(ast, file, preferred, done) { module.exports = blockquoteIndentation; -},{"mdast-util-position":62,"mdast-util-to-string":63,"plur":65,"unist-util-visit":66}],5:[function(require,module,exports){ +},{"mdast-util-position":63,"mdast-util-to-string":64,"plur":66,"unist-util-visit":67}],5:[function(require,module,exports){ /** * @author Titus Wormer * @copyright 2015 Titus Wormer @@ -802,7 +821,7 @@ function checkboxCharacterStyle(ast, file, preferred, done) { module.exports = checkboxCharacterStyle; -},{"mdast-util-position":62,"unist-util-visit":66}],6:[function(require,module,exports){ +},{"mdast-util-position":63,"unist-util-visit":67}],6:[function(require,module,exports){ /** * @author Titus Wormer * @copyright 2015 Titus Wormer @@ -902,7 +921,7 @@ function checkboxContentIndent(ast, file, preferred, done) { module.exports = checkboxContentIndent; -},{"mdast-util-position":62,"unist-util-visit":66}],7:[function(require,module,exports){ +},{"mdast-util-position":63,"unist-util-visit":67}],7:[function(require,module,exports){ /** * @author Titus Wormer * @copyright 2015 Titus Wormer @@ -1038,7 +1057,7 @@ function codeBlockStyle(ast, file, preferred, done) { module.exports = codeBlockStyle; -},{"mdast-util-position":62,"unist-util-visit":66}],8:[function(require,module,exports){ +},{"mdast-util-position":63,"unist-util-visit":67}],8:[function(require,module,exports){ /** * @author Titus Wormer * @copyright 2015 Titus Wormer @@ -1115,7 +1134,7 @@ function definitionCase(ast, file, preferred, done) { module.exports = definitionCase; -},{"mdast-util-position":62,"unist-util-visit":66}],9:[function(require,module,exports){ +},{"mdast-util-position":63,"unist-util-visit":67}],9:[function(require,module,exports){ /** * @author Titus Wormer * @copyright 2015 Titus Wormer @@ -1192,7 +1211,7 @@ function definitionSpacing(ast, file, preferred, done) { module.exports = definitionSpacing; -},{"mdast-util-position":62,"unist-util-visit":66}],10:[function(require,module,exports){ +},{"mdast-util-position":63,"unist-util-visit":67}],10:[function(require,module,exports){ /** * @author Titus Wormer * @copyright 2015 Titus Wormer @@ -1279,7 +1298,7 @@ function emphasisMarker(ast, file, preferred, done) { module.exports = emphasisMarker; -},{"mdast-util-position":62,"unist-util-visit":66}],11:[function(require,module,exports){ +},{"mdast-util-position":63,"unist-util-visit":67}],11:[function(require,module,exports){ /** * @author Titus Wormer * @copyright 2015 Titus Wormer @@ -1387,7 +1406,7 @@ function fencedCodeFlag(ast, file, preferred, done) { module.exports = fencedCodeFlag; -},{"mdast-util-position":62,"unist-util-visit":66}],12:[function(require,module,exports){ +},{"mdast-util-position":63,"unist-util-visit":67}],12:[function(require,module,exports){ /** * @author Titus Wormer * @copyright 2015 Titus Wormer @@ -1504,7 +1523,7 @@ function fencedCodeMarker(ast, file, preferred, done) { module.exports = fencedCodeMarker; -},{"mdast-util-position":62,"unist-util-visit":66}],13:[function(require,module,exports){ +},{"mdast-util-position":63,"unist-util-visit":67}],13:[function(require,module,exports){ /** * @author Titus Wormer * @copyright 2015 Titus Wormer @@ -1630,7 +1649,7 @@ function finalDefinition(ast, file, preferred, done) { module.exports = finalDefinition; -},{"mdast-util-position":62,"unist-util-visit":66}],15:[function(require,module,exports){ +},{"mdast-util-position":63,"unist-util-visit":67}],15:[function(require,module,exports){ /** * @author Titus Wormer * @copyright 2015 Titus Wormer @@ -1726,7 +1745,7 @@ function firstHeadingLevel(ast, file, preferred, done) { module.exports = firstHeadingLevel; -},{"mdast-util-position":62,"unist-util-visit":66}],17:[function(require,module,exports){ +},{"mdast-util-position":63,"unist-util-visit":67}],17:[function(require,module,exports){ /** * @author Titus Wormer * @copyright 2015 Titus Wormer @@ -1789,7 +1808,7 @@ function hardBreakSpaces(ast, file, preferred, done) { module.exports = hardBreakSpaces; -},{"mdast-util-position":62,"unist-util-visit":66}],18:[function(require,module,exports){ +},{"mdast-util-position":63,"unist-util-visit":67}],18:[function(require,module,exports){ /** * @author Titus Wormer * @copyright 2015 Titus Wormer @@ -1855,7 +1874,7 @@ function headingIncrement(ast, file, preferred, done) { module.exports = headingIncrement; -},{"mdast-util-position":62,"unist-util-visit":66}],19:[function(require,module,exports){ +},{"mdast-util-position":63,"unist-util-visit":67}],19:[function(require,module,exports){ /** * @author Titus Wormer * @copyright 2015 Titus Wormer @@ -1956,7 +1975,7 @@ function headingStyle(ast, file, preferred, done) { module.exports = headingStyle; -},{"mdast-util-heading-style":61,"mdast-util-position":62,"unist-util-visit":66}],20:[function(require,module,exports){ +},{"mdast-util-heading-style":62,"mdast-util-position":63,"unist-util-visit":67}],20:[function(require,module,exports){ /** * @author Titus Wormer * @copyright 2015 Titus Wormer @@ -2170,7 +2189,7 @@ function linkTitleStyle(ast, file, preferred, done) { module.exports = linkTitleStyle; -},{"mdast-util-position":62,"unist-util-visit":66}],22:[function(require,module,exports){ +},{"mdast-util-position":63,"unist-util-visit":67}],22:[function(require,module,exports){ /** * @author Titus Wormer * @copyright 2015 Titus Wormer @@ -2250,7 +2269,7 @@ function listItemBulletIndent(ast, file, preferred, done) { module.exports = listItemBulletIndent; -},{"mdast-util-position":62,"plur":65,"unist-util-visit":66}],23:[function(require,module,exports){ +},{"mdast-util-position":63,"plur":66,"unist-util-visit":67}],23:[function(require,module,exports){ /** * @author Titus Wormer * @copyright 2015 Titus Wormer @@ -2365,7 +2384,7 @@ function listItemContentIndent(ast, file, preferred, done) { module.exports = listItemContentIndent; -},{"mdast-util-position":62,"plur":65,"unist-util-visit":66}],24:[function(require,module,exports){ +},{"mdast-util-position":63,"plur":66,"unist-util-visit":67}],24:[function(require,module,exports){ /** * @author Titus Wormer * @copyright 2015 Titus Wormer @@ -2516,7 +2535,7 @@ function listItemIndent(ast, file, preferred, done) { module.exports = listItemIndent; -},{"mdast-util-position":62,"plur":65,"unist-util-visit":66}],25:[function(require,module,exports){ +},{"mdast-util-position":63,"plur":66,"unist-util-visit":67}],25:[function(require,module,exports){ /** * @author Titus Wormer * @copyright 2015 Titus Wormer @@ -2637,7 +2656,7 @@ function listItemSpacing(ast, file, preferred, done) { module.exports = listItemSpacing; -},{"mdast-util-position":62,"unist-util-visit":66}],26:[function(require,module,exports){ +},{"mdast-util-position":63,"unist-util-visit":67}],26:[function(require,module,exports){ /** * @author Titus Wormer * @copyright 2015 Titus Wormer @@ -2699,7 +2718,7 @@ function maximumHeadingLength(ast, file, preferred, done) { module.exports = maximumHeadingLength; -},{"mdast-util-position":62,"mdast-util-to-string":63,"unist-util-visit":66}],27:[function(require,module,exports){ +},{"mdast-util-position":63,"mdast-util-to-string":64,"unist-util-visit":67}],27:[function(require,module,exports){ /** * @author Titus Wormer * @copyright 2015 Titus Wormer @@ -2887,7 +2906,7 @@ function maximumLineLength(ast, file, preferred, done) { module.exports = maximumLineLength; -},{"mdast-util-position":62,"unist-util-visit":66}],28:[function(require,module,exports){ +},{"mdast-util-position":63,"unist-util-visit":67}],28:[function(require,module,exports){ /** * @author Titus Wormer * @copyright 2015 Titus Wormer @@ -2974,7 +2993,7 @@ function noAutoLinkWithoutProtocol(ast, file, preferred, done) { module.exports = noAutoLinkWithoutProtocol; -},{"mdast-util-position":62,"mdast-util-to-string":63,"unist-util-visit":66}],29:[function(require,module,exports){ +},{"mdast-util-position":63,"mdast-util-to-string":64,"unist-util-visit":67}],29:[function(require,module,exports){ /** * @author Titus Wormer * @copyright 2015 Titus Wormer @@ -3061,7 +3080,7 @@ function noBlockquoteWithoutCaret(ast, file, preferred, done) { module.exports = noBlockquoteWithoutCaret; -},{"mdast-util-position":62,"unist-util-visit":66}],30:[function(require,module,exports){ +},{"mdast-util-position":63,"unist-util-visit":67}],30:[function(require,module,exports){ /** * @author Titus Wormer * @copyright 2015 Titus Wormer @@ -3192,7 +3211,7 @@ function noConsecutiveBlankLines(ast, file, preferred, done) { module.exports = noConsecutiveBlankLines; -},{"mdast-util-position":62,"plur":65,"unist-util-visit":66}],31:[function(require,module,exports){ +},{"mdast-util-position":63,"plur":66,"unist-util-visit":67}],31:[function(require,module,exports){ /** * @author Titus Wormer * @copyright 2015 Titus Wormer @@ -3270,7 +3289,7 @@ function noDuplicateDefinitions(ast, file, preferred, done) { module.exports = noDuplicateDefinitions; -},{"mdast-util-position":62,"unist-util-visit":66}],32:[function(require,module,exports){ +},{"mdast-util-position":63,"unist-util-visit":67}],32:[function(require,module,exports){ /** * @author Titus Wormer * @copyright 2015 Titus Wormer @@ -3346,7 +3365,7 @@ function noDuplicateHeadings(ast, file, preferred, done) { module.exports = noDuplicateHeadings; -},{"mdast-util-position":62,"mdast-util-to-string":63,"unist-util-visit":66}],33:[function(require,module,exports){ +},{"mdast-util-position":63,"mdast-util-to-string":64,"unist-util-visit":67}],33:[function(require,module,exports){ /** * @author Titus Wormer * @copyright 2015 Titus Wormer @@ -3430,7 +3449,7 @@ function noEmphasisAsHeading(ast, file, preferred, done) { module.exports = noEmphasisAsHeading; -},{"mdast-util-position":62,"mdast-util-to-string":63,"unist-util-visit":66}],34:[function(require,module,exports){ +},{"mdast-util-position":63,"mdast-util-to-string":64,"unist-util-visit":67}],34:[function(require,module,exports){ /** * @author Titus Wormer * @copyright 2015 Titus Wormer @@ -3747,7 +3766,7 @@ function noHeadingContentIndent(ast, file, preferred, done) { module.exports = noHeadingContentIndent; -},{"mdast-util-heading-style":61,"mdast-util-position":62,"plur":65,"unist-util-visit":66}],40:[function(require,module,exports){ +},{"mdast-util-heading-style":62,"mdast-util-position":63,"plur":66,"unist-util-visit":67}],40:[function(require,module,exports){ /** * @author Titus Wormer * @copyright 2015 Titus Wormer @@ -3851,7 +3870,7 @@ function noHeadingIndent(ast, file, preferred, done) { module.exports = noHeadingIndent; -},{"mdast-util-position":62,"plur":65,"unist-util-visit":66}],41:[function(require,module,exports){ +},{"mdast-util-position":63,"plur":66,"unist-util-visit":67}],41:[function(require,module,exports){ /** * @author Titus Wormer * @copyright 2015 Titus Wormer @@ -3925,7 +3944,7 @@ function noHeadingPunctuation(ast, file, preferred, done) { module.exports = noHeadingPunctuation; -},{"mdast-util-position":62,"mdast-util-to-string":63,"unist-util-visit":66}],42:[function(require,module,exports){ +},{"mdast-util-position":63,"mdast-util-to-string":64,"unist-util-visit":67}],42:[function(require,module,exports){ /** * @author Titus Wormer * @copyright 2015 Titus Wormer @@ -3973,7 +3992,7 @@ function html(ast, file, preferred, done) { module.exports = html; -},{"mdast-util-position":62,"unist-util-visit":66}],43:[function(require,module,exports){ +},{"mdast-util-position":63,"unist-util-visit":67}],43:[function(require,module,exports){ /** * @author Titus Wormer * @copyright 2015 Titus Wormer @@ -4044,7 +4063,7 @@ function noInlinePadding(ast, file, preferred, done) { module.exports = noInlinePadding; -},{"mdast-util-position":62,"mdast-util-to-string":63,"unist-util-visit":66}],44:[function(require,module,exports){ +},{"mdast-util-position":63,"mdast-util-to-string":64,"unist-util-visit":67}],44:[function(require,module,exports){ /** * @author Titus Wormer * @copyright 2015 Titus Wormer @@ -4109,7 +4128,7 @@ function noLiteralURLs(ast, file, preferred, done) { module.exports = noLiteralURLs; -},{"mdast-util-position":62,"unist-util-visit":66}],45:[function(require,module,exports){ +},{"mdast-util-position":63,"unist-util-visit":67}],45:[function(require,module,exports){ /** * @author Titus Wormer * @copyright 2015 Titus Wormer @@ -4193,7 +4212,7 @@ function noMissingBlankLines(ast, file, preferred, done) { module.exports = noMissingBlankLines; -},{"mdast-util-position":62,"unist-util-visit":66}],46:[function(require,module,exports){ +},{"mdast-util-position":63,"unist-util-visit":67}],46:[function(require,module,exports){ /** * @author Titus Wormer * @copyright 2015 Titus Wormer @@ -4256,7 +4275,7 @@ function noMultipleToplevelHeadings(ast, file, preferred, done) { module.exports = noMultipleToplevelHeadings; -},{"mdast-util-position":62,"unist-util-visit":66}],47:[function(require,module,exports){ +},{"mdast-util-position":63,"unist-util-visit":67}],47:[function(require,module,exports){ /** * @author Titus Wormer * @copyright 2015 Titus Wormer @@ -4359,7 +4378,7 @@ function noShellDollars(ast, file, preferred, done) { module.exports = noShellDollars; -},{"mdast-util-position":62,"unist-util-visit":66}],48:[function(require,module,exports){ +},{"mdast-util-position":63,"unist-util-visit":67}],48:[function(require,module,exports){ /** * @author Titus Wormer * @copyright 2015 Titus Wormer @@ -4416,7 +4435,7 @@ function noShortcutReferenceImage(ast, file, preferred, done) { module.exports = noShortcutReferenceImage; -},{"mdast-util-position":62,"unist-util-visit":66}],49:[function(require,module,exports){ +},{"mdast-util-position":63,"unist-util-visit":67}],49:[function(require,module,exports){ /** * @author Titus Wormer * @copyright 2015 Titus Wormer @@ -4473,7 +4492,7 @@ function noShortcutReferenceLink(ast, file, preferred, done) { module.exports = noShortcutReferenceLink; -},{"mdast-util-position":62,"unist-util-visit":66}],50:[function(require,module,exports){ +},{"mdast-util-position":63,"unist-util-visit":67}],50:[function(require,module,exports){ /** * @author Titus Wormer * @copyright 2015 Titus Wormer @@ -4536,7 +4555,7 @@ function noTableIndentation(ast, file, preferred, done) { module.exports = noTableIndentation; -},{"mdast-util-position":62,"unist-util-visit":66}],51:[function(require,module,exports){ +},{"mdast-util-position":63,"unist-util-visit":67}],51:[function(require,module,exports){ /** * @author Titus Wormer * @copyright 2015 Titus Wormer @@ -4706,7 +4725,7 @@ function orderedListMarkerStyle(ast, file, preferred, done) { module.exports = orderedListMarkerStyle; -},{"mdast-util-position":62,"unist-util-visit":66}],53:[function(require,module,exports){ +},{"mdast-util-position":63,"unist-util-visit":67}],53:[function(require,module,exports){ /** * @author Titus Wormer * @copyright 2015 Titus Wormer @@ -4865,7 +4884,7 @@ function orderedListMarkerValue(ast, file, preferred, done) { module.exports = orderedListMarkerValue; -},{"mdast-util-position":62,"unist-util-visit":66}],54:[function(require,module,exports){ +},{"mdast-util-position":63,"unist-util-visit":67}],54:[function(require,module,exports){ /** * @author Titus Wormer * @copyright 2015 Titus Wormer @@ -4965,7 +4984,7 @@ function ruleStyle(ast, file, preferred, done) { module.exports = ruleStyle; -},{"mdast-util-position":62,"unist-util-visit":66}],55:[function(require,module,exports){ +},{"mdast-util-position":63,"unist-util-visit":67}],55:[function(require,module,exports){ /** * @author Titus Wormer * @copyright 2015 Titus Wormer @@ -5050,7 +5069,7 @@ function strongMarker(ast, file, preferred, done) { module.exports = strongMarker; -},{"mdast-util-position":62,"unist-util-visit":66}],56:[function(require,module,exports){ +},{"mdast-util-position":63,"unist-util-visit":67}],56:[function(require,module,exports){ /** * @author Titus Wormer * @copyright 2015 Titus Wormer @@ -5229,7 +5248,7 @@ function tableCellPadding(ast, file, preferred, done) { module.exports = tableCellPadding; -},{"mdast-util-position":62,"unist-util-visit":66}],57:[function(require,module,exports){ +},{"mdast-util-position":63,"unist-util-visit":67}],57:[function(require,module,exports){ /** * @author Titus Wormer * @copyright 2015 Titus Wormer @@ -5332,7 +5351,7 @@ function tablePipeAlignment(ast, file, preferred, done) { module.exports = tablePipeAlignment; -},{"mdast-util-position":62,"unist-util-visit":66}],58:[function(require,module,exports){ +},{"mdast-util-position":63,"unist-util-visit":67}],58:[function(require,module,exports){ /** * @author Titus Wormer * @copyright 2015 Titus Wormer @@ -5410,7 +5429,7 @@ function tablePipes(ast, file, preferred, done) { module.exports = tablePipes; -},{"mdast-util-position":62,"unist-util-visit":66}],59:[function(require,module,exports){ +},{"mdast-util-position":63,"unist-util-visit":67}],59:[function(require,module,exports){ /** * @author Titus Wormer * @copyright 2015 Titus Wormer @@ -5534,7 +5553,17 @@ function unorderedListMarkerStyle(ast, file, preferred, done) { module.exports = unorderedListMarkerStyle; -},{"mdast-util-position":62,"unist-util-visit":66}],60:[function(require,module,exports){ +},{"mdast-util-position":63,"unist-util-visit":67}],60:[function(require,module,exports){ +'use strict'; +module.exports = function (str, sep) { + if (typeof str !== 'string') { + throw new TypeError('Expected a string'); + } + + return str.replace(/([a-z\d])([A-Z])/g, '$1' + (sep || '_') + '$2').toLowerCase(); +}; + +},{}],61:[function(require,module,exports){ /** * @author Titus Wormer * @copyright 2015 Titus Wormer @@ -5714,7 +5743,7 @@ function attacher() { module.exports = attacher; -},{"unist-util-visit":66}],61:[function(require,module,exports){ +},{"unist-util-visit":67}],62:[function(require,module,exports){ /** * @author Titus Wormer * @copyright 2015 Titus Wormer. All rights reserved. @@ -5804,7 +5833,7 @@ function style(node, relative) { module.exports = style; -},{}],62:[function(require,module,exports){ +},{}],63:[function(require,module,exports){ /** * @author Titus Wormer * @copyright 2015 Titus Wormer. All rights reserved. @@ -5908,7 +5937,7 @@ position.generated = generated; module.exports = position; -},{}],63:[function(require,module,exports){ +},{}],64:[function(require,module,exports){ /** * @author Titus Wormer * @copyright 2015 Titus Wormer. All rights reserved. @@ -5951,7 +5980,7 @@ function toString(node) { module.exports = toString; -},{}],64:[function(require,module,exports){ +},{}],65:[function(require,module,exports){ /** * @author Titus Wormer * @copyright 2015 Titus Wormer @@ -6322,7 +6351,7 @@ function wrapper(options) { module.exports = wrapper; -},{"unist-util-visit":66}],65:[function(require,module,exports){ +},{"unist-util-visit":67}],66:[function(require,module,exports){ 'use strict'; module.exports = function (str, plural, count) { if (typeof plural === 'number') { @@ -6338,7 +6367,7 @@ module.exports = function (str, plural, count) { return count === 1 ? str : plural; }; -},{}],66:[function(require,module,exports){ +},{}],67:[function(require,module,exports){ /** * @author Titus Wormer * @copyright 2015 Titus Wormer. All rights reserved. @@ -6453,7 +6482,7 @@ function visit(tree, type, callback, reverse) { module.exports = visit; -},{}],67:[function(require,module,exports){ +},{}],68:[function(require,module,exports){ /** * @author Titus Wormer * @copyright 2015 Titus Wormer diff --git a/mdast-lint.min.js b/mdast-lint.min.js index d26eaf47..f70be623 100644 --- a/mdast-lint.min.js +++ b/mdast-lint.min.js @@ -1 +1 @@ -!function(b,a){typeof exports==='object'&&typeof module!=='undefined'?module.exports=b():typeof define==='function'&&define.amd?define([],b):(typeof window!=='undefined'?a=window:typeof global!=='undefined'?a=global:typeof self!=='undefined'?a=self:a=this,a.mdastLint=b())}(function(){return function a(b,c,e){function f(d,k){if(!c[d]){if(!b[d]){var i=typeof require=='function'&&require;if(!k&&i)return i(d,!0);if(g)return g(d,!0);var j=new Error("Cannot find module '"+d+"'");throw j.code='MODULE_NOT_FOUND',j}var h=c[d]={exports:{}};b[d][0].call(h.exports,function(c){var a=b[d][1][c];return f(a?a:c)},h,h.exports,a,b,c,e)}return c[d].exports}var g=typeof require=='function'&&require;for(var d=0;da)return;g&&(d.push({start:e,end:a}),g=!1),e=a}var i=h.children[h.children.length-1],d=[],e=0,g=!1,j=b.namespace('mdast-lint').ranges;if(!(b&&b.messages&&b.messages.length))return;c(h,function(b){var c=a.start(b),d=a.end(b);f(c&&c.offset),b.children||f(d&&d.offset)}),e===a.end(i).offset&&(f(),f(b.toString().length-1)),b.messages=b.messages.filter(function(a){var e=j[a.ruleId],g=e&&e.length,f=d.length,i=-1,h,c;a.line||(a.line=1),a.column||(a.column=1),h=b.positionToOffset(a);while(f--)if(d[f].start<=h&&d[f].end>h)return!1;while(--g>i)if(c=e[g],c.position.line0?'Add':'Remove',d=Math.abs(d),d!==0&&g.warn(i+' '+d+' '+f('space',d)+' between blockquote and content',a.start(e.children[0]))):b=c(e)}),h()}var d=b('unist-util-visit'),e=b('mdast-util-to-string'),f=b('plur'),a=b('mdast-util-position');g.exports=h},{'mdast-util-position':62,'mdast-util-to-string':63,plur:65,'unist-util-visit':66}],5:[function(f,i,j){'use strict';function h(j,h,f,k){var i=h.toString();(f==='consistent'||typeof f!=='object')&&(f={}),f.unchecked||(f.unchecked=null),f.checked||(f.checked=null),f.unchecked!==null&&e[f.unchecked]!==!0&&h.fail('Invalid unchecked checkbox marker `'+f.unchecked+"`: use either `'\\t'`, or `' '`"),f.checked!==null&&g[f.checked]!==!0&&h.fail('Invalid checked checkbox marker `'+f.checked+"`: use either `'x'`, or `'X'`"),c(j,'listItem',function(c){var e,k,n,l,g,j,m;if(c.checked!==Boolean(c.checked)||a.generated(c))return;e=c.checked?'checked':'unchecked',k=b(c).offset,n=(c.children.length?b(c.children[0]):d(c)).offset,g=i.slice(k,n).trimRight().slice(0,-1),m=g.charAt(g.length-1),j=f[e],j===null?f[e]=m:m!==j&&(l=k+g.length,h.warn(e.charAt(0).toUpperCase()+e.slice(1)+' checkboxes should use `'+j+'` as a marker',{start:h.offsetToPosition(l-1),end:h.offsetToPosition(l)}))}),k()}var c=f('unist-util-visit'),a=f('mdast-util-position'),b=a.start,d=a.end,g={x:!0,X:!0},e={' ':!0,' ':!0};i.exports=h},{'mdast-util-position':62,'unist-util-visit':66}],6:[function(c,f,h){'use strict';function g(g,c,i,h){var f=c.toString();d(g,'listItem',function(d){var i,g,h;if(d.checked!==Boolean(d.checked)||a.generated(d))return;i=b(d).offset,g=(d.children.length?b(d.children[0]):e(d)).offset;while(/[^\S\n]/.test(f.charAt(g)))g++;if(h=f.slice(i,g),h=h.slice(h.indexOf(']')+1),h.length===1)return;c.warn('Checkboxes should be followed by a single character',{start:c.offsetToPosition(g-h.length+1),end:c.offsetToPosition(g)})}),h()}var d=c('unist-util-visit'),a=c('mdast-util-position'),b=a.start,e=a.end;f.exports=g},{'mdast-util-position':62,'unist-util-visit':66}],7:[function(b,g,i){'use strict';function h(i,g,b,j){function k(b){var c=d(b).offset,f=e(b).offset;return a.generated(b)?null:b.lang||/^\s*([~`])\1{2,}/.test(h.slice(c,f))?'fenced':'indented'}var h=g.toString();if(b=typeof b!=='string'||b==='consistent'?null:b,f[b]!==!0){g.fail('Invalid code block style `'+b+"`: use either `'consistent'`, `'fenced'`, or `'indented'`");return}c(i,'code',function(c){var a=k(c);if(!a)return;b?b!==a&&g.warn('Code blocks should be '+b,c):b=a}),j()}var c=b('unist-util-visit'),a=b('mdast-util-position'),d=a.start,e=a.end,f={null:!0,fenced:!0,indented:!0};g.exports=h},{'mdast-util-position':62,'unist-util-visit':66}],8:[function(c,e,g){'use strict';function f(c,e,i,h){function f(b){var f=a.start(b).offset,h=a.end(b).offset,c;if(a.generated(b))return;c=g.slice(f,h).match(d)[1],c!==c.toLowerCase()&&e.warn('Do not use upper-case characters in definition labels',b)}var g=e.toString();b(c,'definition',f),b(c,'footnoteDefinition',f),h()}var b=c('unist-util-visit'),a=c('mdast-util-position'),d=/^\s*\[((?:\\[\s\S]|[^\[\]])+)\]/;e.exports=f},{'mdast-util-position':62,'unist-util-visit':66}],9:[function(c,e,g){'use strict';function f(c,e,i,h){function f(b){var c=a.start(b).offset,f=a.end(b).offset,h;if(a.generated(b))return;h=g.slice(c,f).match(d)[1],/[ \t\n]{2,}/.test(h)&&e.warn('Do not use consecutive white-space in definition labels',b)}var g=e.toString();b(c,'definition',f),b(c,'footnoteDefinition',f),h()}var b=c('unist-util-visit'),a=c('mdast-util-position'),d=/^\s*\[((?:\\[\s\S]|[^\[\]])+)\]/;e.exports=f},{'mdast-util-position':62,'unist-util-visit':66}],10:[function(b,e,g){'use strict';function f(f,e,b,g){if(b=typeof b!=='string'||b==='consistent'?null:b,d[b]!==!0){e.fail('Invalid emphasis marker `'+b+"`: use either `'consistent'`, `'*'`, or `'_'`");return}c(f,'emphasis',function(c){var d=e.toString().charAt(a.start(c).offset);if(a.generated(c))return;b?d!==b&&e.warn('Emphasis should use `'+b+'` as a marker',c):b=d}),g()}var c=b('unist-util-visit'),a=b('mdast-util-position'),d={'*':!0,_:!0,null:!0};e.exports=f},{'mdast-util-position':62,'unist-util-visit':66}],11:[function(b,f,h){'use strict';function g(j,g,b,k){var i=g.toString(),h=!1,f=[];typeof b==='object'&&!('length'in b)&&(h=Boolean(b.allowEmpty),b=b.flags),typeof b==='object'&&'length'in b&&(f=String(b).split(',')),c(j,'code',function(b){var c=i.slice(d(b).offset,e(b).offset);if(a.generated(b))return;b.lang?f.length&&f.indexOf(b.lang)===-1&&g.warn('Invalid code-language flag',b):/^\ {0,3}([~`])\1{2,}/.test(c)&&!h&&g.warn('Missing code-language flag',b)}),k()}var c=b('unist-util-visit'),a=b('mdast-util-position'),d=a.start,e=a.end;f.exports=g},{'mdast-util-position':62,'unist-util-visit':66}],12:[function(c,e,g){'use strict';function f(g,e,c,h){var f=e.toString();if(c=typeof c!=='string'||c==='consistent'?null:c,b[c]!==!0){e.fail('Invalid fenced code marker `'+c+"`: use either `'consistent'`, `` '`' ``, or `'~'`");return}d(g,'code',function(g){var d=f.substr(a.start(g).offset,4);if(a.generated(g))return;if(d=d.trimLeft().charAt(0),b[d]!==!0)return;c?d!==c&&e.warn('Fenced code should use '+c+' as a marker',g):c=d}),h()}var d=c('unist-util-visit'),a=c('mdast-util-position'),b={'`':!0,'~':!0,null:!0};e.exports=f},{'mdast-util-position':62,'unist-util-visit':66}],13:[function(c,a,d){'use strict';function b(e,c,a,d){var b=c.extension;a=typeof a==='string'?a:'md',b!==''&&b!==a&&c.warn('Invalid extension: use `'+a+'`'),d()}a.exports=b},{}],14:[function(b,e,g){'use strict';function f(e,f,h,g){var b=null;c(e,function(c){var e=d(c).line;if(c.type==='root'||a.generated(c))return;c.type==='definition'?b!==null&&b>e&&f.warn('Move definitions to the end of the file (after the node at line `'+b+'`)',c):b===null&&(b=e)},!0),g()}var c=b('unist-util-visit'),a=b('mdast-util-position'),d=a.start;e.exports=f},{'mdast-util-position':62,'unist-util-visit':66}],15:[function(c,a,d){'use strict';function b(e,c,f,d){var a=c.toString(),b=a.length-1;b>0&&a.charAt(b)!=='\n'&&c.warn('Missing newline character at end of file'),d()}a.exports=b},{}],16:[function(a,d,f){'use strict';function e(a,d,f,e){b(a,'heading',function(a){return c.generated(a)?null:(a.depth!==1&&d.warn('First heading level should be `1`',a),!1)}),e()}var b=a('unist-util-visit'),c=a('mdast-util-position');d.exports=e},{'mdast-util-position':62,'unist-util-visit':66}],17:[function(b,d,f){'use strict';function e(e,b,g,f){var d=b.toString();c(e,'break',function(c){var e=a.start(c).offset,f=a.end(c).offset;if(a.generated(c))return;d.slice(e,f).length>3&&b.warn('Use two spaces for hard line breaks',c)}),f()}var c=b('unist-util-visit'),a=b('mdast-util-position');d.exports=e},{'mdast-util-position':62,'unist-util-visit':66}],18:[function(a,d,f){'use strict';function e(d,e,g,f){var a=null;b(d,'heading',function(b){var d=b.depth;if(c.generated(b))return;a&&d>a+1&&e.warn('Heading levels should increment by one level at a time',b),a=d}),f()}var b=a('unist-util-visit'),c=a('mdast-util-position');d.exports=e},{'mdast-util-position':62,'unist-util-visit':66}],19:[function(a,f,h){'use strict';function g(f,g,a,h){a=e.indexOf(a)===-1?null:a,c(f,'heading',function(c){if(d.generated(c))return;a?b(c,a)!==a&&g.warn('Headings should use '+a,c):a=b(c,a)}),h()}var c=a('unist-util-visit'),b=a('mdast-util-heading-style'),d=a('mdast-util-position'),e=['atx','atx-closed','setext'];f.exports=g},{'mdast-util-heading-style':61,'mdast-util-position':62,'unist-util-visit':66}],20:[function(a,b,c){'use strict';b.exports={'no-auto-link-without-protocol':a('./no-auto-link-without-protocol'),'no-literal-urls':a('./no-literal-urls'),'no-consecutive-blank-lines':a('./no-consecutive-blank-lines'),'no-missing-blank-lines':a('./no-missing-blank-lines'),'blockquote-indentation':a('./blockquote-indentation'),'no-blockquote-without-caret':a('./no-blockquote-without-caret'),'code-block-style':a('./code-block-style'),'checkbox-content-indent':a('./checkbox-content-indent'),'checkbox-character-style':a('./checkbox-character-style'),'definition-case':a('./definition-case'),'definition-spacing':a('./definition-spacing'),'no-emphasis-as-heading':a('./no-emphasis-as-heading'),'emphasis-marker':a('./emphasis-marker'),'fenced-code-flag':a('./fenced-code-flag'),'fenced-code-marker':a('./fenced-code-marker'),'file-extension':a('./file-extension'),'final-newline':a('./final-newline'),'no-file-name-articles':a('./no-file-name-articles'),'no-file-name-consecutive-dashes':a('./no-file-name-consecutive-dashes'),'no-file-name-irregular-characters':a('./no-file-name-irregular-characters'),'no-file-name-mixed-case':a('./no-file-name-mixed-case'),'no-file-name-outer-dashes':a('./no-file-name-outer-dashes'),'final-definition':a('./final-definition'),'hard-break-spaces':a('./hard-break-spaces'),'heading-increment':a('./heading-increment'),'no-heading-content-indent':a('./no-heading-content-indent'),'no-heading-indent':a('./no-heading-indent'),'first-heading-level':a('./first-heading-level'),'maximum-heading-length':a('./maximum-heading-length'),'no-heading-punctuation':a('./no-heading-punctuation'),'heading-style':a('./heading-style'),'no-multiple-toplevel-headings':a('./no-multiple-toplevel-headings'),'no-duplicate-headings':a('./no-duplicate-headings'),'no-duplicate-definitions':a('./no-duplicate-definitions'),'no-html':a('./no-html'),'no-inline-padding':a('./no-inline-padding'),'maximum-line-length':a('./maximum-line-length'),'link-title-style':a('./link-title-style'),'list-item-bullet-indent':a('./list-item-bullet-indent'),'list-item-content-indent':a('./list-item-content-indent'),'list-item-indent':a('./list-item-indent'),'list-item-spacing':a('./list-item-spacing'),'ordered-list-marker-style':a('./ordered-list-marker-style'),'ordered-list-marker-value':a('./ordered-list-marker-value'),'no-shortcut-reference-image':a('./no-shortcut-reference-image'),'no-shortcut-reference-link':a('./no-shortcut-reference-link'),'rule-style':a('./rule-style'),'no-shell-dollars':a('./no-shell-dollars'),'strong-marker':a('./strong-marker'),'no-table-indentation':a('./no-table-indentation'),'table-pipe-alignment':a('./table-pipe-alignment'),'table-cell-padding':a('./table-cell-padding'),'table-pipes':a('./table-pipes'),'no-tabs':a('./no-tabs'),'unordered-list-marker-style':a('./unordered-list-marker-style')}},{'./blockquote-indentation':4,'./checkbox-character-style':5,'./checkbox-content-indent':6,'./code-block-style':7,'./definition-case':8,'./definition-spacing':9,'./emphasis-marker':10,'./fenced-code-flag':11,'./fenced-code-marker':12,'./file-extension':13,'./final-definition':14,'./final-newline':15,'./first-heading-level':16,'./hard-break-spaces':17,'./heading-increment':18,'./heading-style':19,'./link-title-style':21,'./list-item-bullet-indent':22,'./list-item-content-indent':23,'./list-item-indent':24,'./list-item-spacing':25,'./maximum-heading-length':26,'./maximum-line-length':27,'./no-auto-link-without-protocol':28,'./no-blockquote-without-caret':29,'./no-consecutive-blank-lines':30,'./no-duplicate-definitions':31,'./no-duplicate-headings':32,'./no-emphasis-as-heading':33,'./no-file-name-articles':34,'./no-file-name-consecutive-dashes':35,'./no-file-name-irregular-characters':36,'./no-file-name-mixed-case':37,'./no-file-name-outer-dashes':38,'./no-heading-content-indent':39,'./no-heading-indent':40,'./no-heading-punctuation':41,'./no-html':42,'./no-inline-padding':43,'./no-literal-urls':44,'./no-missing-blank-lines':45,'./no-multiple-toplevel-headings':46,'./no-shell-dollars':47,'./no-shortcut-reference-image':48,'./no-shortcut-reference-link':49,'./no-table-indentation':50,'./no-tabs':51,'./ordered-list-marker-style':52,'./ordered-list-marker-value':53,'./rule-style':54,'./strong-marker':55,'./table-cell-padding':56,'./table-pipe-alignment':57,'./table-pipes':58,'./unordered-list-marker-style':59}],21:[function(d,f,h){'use strict';function g(g,f,d,j){function h(h){var a=e(h).offset-1,g,j;if(b.generated(h))return;h.type!=='definition'&&a--;while(a){if(g=i.charAt(a),!/\s/.test(g))break;a--}if(!(g in c))return;d?d!==g&&(j=f.offsetToPosition(a+1),f.warn(d===')'?'Titles should use `()` as a quote':'Titles should use `'+d+'` as a quote',j)):d=g}var i=f.toString();if(d=typeof d!=='string'||d==='consistent'?null:d,(d==='()'||d==='(')&&(d=')'),c[d]!==!0){f.fail('Invalid link title style marker `'+d+"`: use either `'consistent'`, `'\"'`, `'\\''`, or `'()'`");return}a(g,'link',h),a(g,'image',h),a(g,'definition',h),j()}var a=d('unist-util-visit'),b=d('mdast-util-position'),c={'"':!0,"'":!0,')':!0,null:!0},e=b.end;f.exports=g},{'mdast-util-position':62,'unist-util-visit':66}],22:[function(b,f,h){'use strict';function g(g,b,i,h){var f=b.toString();d(g,'list',function(d){var g=d.children;g.forEach(function(j){var i=j.children[0],g=a(j).offset,k=a(i).offset,h;if(c.generated(d))return;h=f.slice(g,k).match(/^\s*/)[0].length,h!==0&&(g=a(i),b.warn('Incorrect indentation before bullet: remove '+h+' '+e('space',h),{line:g.line,column:g.column-h}))})}),h()}var d=b('unist-util-visit'),c=b('mdast-util-position'),e=b('plur'),a=c.start;f.exports=g},{'mdast-util-position':62,plur:65,'unist-util-visit':66}],23:[function(a,f,h){'use strict';function g(g,a,i,h){var f=a.toString();d(g,'listItem',function(d){var g;d.children.forEach(function(l,n){var j=c(l),h=j.column,k,i,m;if(b.generated(l))return;if(n===0){if(Boolean(d.checked)===d.checked){k=j.offset;while(f.charAt(k)!=='[')k--;h-=j.offset-k}g=h;return}h!==g&&(i=g-h,m=i>0?'add':'remove',i=Math.abs(i),a.warn('Don’t use mixed indentation for children, '+m+' '+i+' '+e('space',i),{line:c(l).line,column:h}))})}),h()}var d=a('unist-util-visit'),b=a('mdast-util-position'),e=a('plur'),c=b.start;f.exports=g},{'mdast-util-position':62,plur:65,'unist-util-visit':66}],24:[function(b,g,i){'use strict';function h(i,g,b,j){var h=g.toString();if(b=typeof b!=='string'?'tab-size':b,f[b]!==!0){g.fail('Invalid list-item indent style `'+b+"`: use either `'tab-size'`, `'space'`, or `'mixed'`");return}d(i,'list',function(d){var f=d.children,i=d.ordered,j=d.start||1;if(c.generated(d))return;f.forEach(function(r,s){var m=r.children[0],l=i?String(j+s).length+1:1,n=Math.ceil(l/4)*4,o=a(r).offset,p=a(m).offset,f,k,c,q;f=h.slice(o,p),f=f.replace(/\[[x ]?\]\s*$/i,''),b==='tab-size'?k=n:b==='space'?k=l+1:k=d.loose?n:l+1,f.length!==k&&(c=k-f.length,q=c>0?'add':'remove',c=Math.abs(c),g.warn('Incorrect list-item indent: '+q+' '+c+' '+e('space',c),a(m)))})}),j()}var d=b('unist-util-visit'),c=b('mdast-util-position'),e=b('plur'),a=c.start,f={'tab-size':!0,mixed:!0,space:!0};g.exports=h},{'mdast-util-position':62,plur:65,'unist-util-visit':66}],25:[function(d,f,h){'use strict';function g(d,f,h,g){e(d,'list',function(g){var d=g.children,e=!0,h=b(g).column,i;if(a.generated(g))return;d.forEach(function(h){var a=h.children,d=a[0],f=a[a.length-1],g=c(f).line-b(d).line>0;g&&(e=!1)}),i=e?'tight':'loose',d.forEach(function(g,k){var a=d[k+1],j=c(g).column>h;if(!a)return;j!==e&&f.warn('List item should be '+i+', isn’t',{start:c(g),end:b(a)})})}),g()}var e=d('unist-util-visit'),a=d('mdast-util-position'),b=a.start,c=a.end;f.exports=g},{'mdast-util-position':62,'unist-util-visit':66}],26:[function(a,e,g){'use strict';function f(e,f,a,g){a=isNaN(a)||typeof a!=='number'?60:a,b(e,'heading',function(b){if(d.generated(b))return;c(b).length>a&&f.warn('Use headings shorter than `'+a+'`',b)}),g()}var b=a('unist-util-visit'),c=a('mdast-util-to-string'),d=a('mdast-util-position');e.exports=f},{'mdast-util-position':62,'mdast-util-to-string':63,'unist-util-visit':66}],27:[function(e,f,i){'use strict';function g(a){return a.type==='heading'||a.type==='table'||a.type==='code'||a.type==='definition'}function h(k,l,j,q){function p(a,b){a--;while(++ae||h.columne&&l.warn('Line must be at most '+e+' characters',{line:h+1,column:i+1});q()}var b=e('unist-util-visit'),a=e('mdast-util-position'),c=a.start,d=a.end;f.exports=h},{'mdast-util-position':62,'unist-util-visit':66}],28:[function(d,j,k){'use strict';function i(a){return g.test(f(a))}function h(d,f,h,g){e(d,'link',function(d){var e=c(d.children[0]).column,g=b(d.children[d.children.length-1]).column,h=c(d).column,j=b(d).column;if(a.generated(d))return;h===e-1&&j===g+1&&!i(d)&&f.warn('All automatic links must start with a protocol',d)}),g()}var e=d('unist-util-visit'),f=d('mdast-util-to-string'),a=d('mdast-util-position'),c=a.start,b=a.end,g=/^[a-z][a-z+.-]+:\/?/i;j.exports=h},{'mdast-util-position':62,'mdast-util-to-string':63,'unist-util-visit':66}],29:[function(b,d,f){'use strict';function e(f,b,h,g){var d=b.toString(),e=d.length;c(f,'blockquote',function(c){var g=a.start(c).line,f=c.position&&c.position.indent;if(a.generated(c)||!f||!f.length)return;f.forEach(function(h,i){var a,c=g+i+1,f=b.positionToOffset({line:c,column:h})-1;while(++f')return;if(a!==' '&&a!==' ')break}b.warn('Missing caret in blockquote',{line:c,column:h})})}),g()}var c=b('unist-util-visit'),a=b('mdast-util-position');d.exports=e},{'mdast-util-position':62,'unist-util-visit':66}],30:[function(b,f,h){'use strict';function g(f,g,i,h){function b(e,b,f){var a=b.line-e.line,c=a>0?'before':'after';a=Math.abs(a)-f,a>0&&g.warn('Remove '+a+' '+d('line',a)+' '+c+' node',b)}c(f,function(d){var c=d.children;if(a.generated(d))return;c&&c[0]&&(b(a.start(d),a.start(c[0]),0),c.forEach(function(f,h){var d=c[h-1],g=e;if(!d||a.generated(d)||a.generated(f))return;(d.type==='list'&&f.type==='list'||f.type==='code'&&d.type==='list'&&!f.lang)&&g++,b(a.end(d),a.start(f),g)}),b(a.end(d),a.end(c[c.length-1]),1))}),h()}var c=b('unist-util-visit'),a=b('mdast-util-position'),d=b('plur'),e=2;f.exports=g},{'mdast-util-position':62,plur:65,'unist-util-visit':66}],31:[function(c,d,f){'use strict';function e(d,f,h,g){function e(b){var d=c[b.identifier],e;if(a.generated(b))return;d&&d.type&&(e=a.start(d),f.warn('Do not use definitions with the same identifier ('+e.line+':'+e.column+')',b)),c[b.identifier]=b}var c={};b(d,'definition',e),b(d,'footnoteDefinition',e),g()}var a=c('mdast-util-position'),b=c('unist-util-visit');d.exports=e},{'mdast-util-position':62,'unist-util-visit':66}],32:[function(a,e,g){'use strict';function f(e,f,h,g){var a={};c(e,'heading',function(c){var g=d(c).toUpperCase(),e=a[g],h;if(b.generated(c))return;e&&e.type==='heading'&&(h=b.start(e),f.warn('Do not use headings with similar content ('+h.line+':'+h.column+')',c)),a[g]=c}),g()}var b=a('mdast-util-position'),c=a('unist-util-visit'),d=a('mdast-util-to-string');e.exports=f},{'mdast-util-position':62,'mdast-util-to-string':63,'unist-util-visit':66}],33:[function(a,e,g){'use strict';function f(a,e,g,f){b(a,'paragraph',function(b,j,k){var f=b.children,a=f[0],g=k.children[j-1],h=k.children[j+1],i;if(d.generated(b))return;(!g||g.type!=='heading')&&h&&h.type==='paragraph'&&f.length===1&&(a.type==='emphasis'||a.type==='strong')&&(i=c(a),i.charAt(i.length-1)===':'&&e.warn('Don’t use emphasis to introduce a section, use a heading',b))}),f()}var b=a('unist-util-visit'),c=a('mdast-util-to-string'),d=a('mdast-util-position');e.exports=f},{'mdast-util-position':62,'mdast-util-to-string':63,'unist-util-visit':66}],34:[function(c,a,d){'use strict';function b(d,a,e,c){var b=a.filename&&a.filename.match(/^(the|an?)\b/i);b&&a.warn('Do not start file names with `'+b[0]+'`'),c()}a.exports=b},{}],35:[function(c,a,d){'use strict';function b(c,a,d,b){a.filename&&/-{2,}/.test(a.filename)&&a.warn('Do not use consecutive dashes in a file name'),b()}a.exports=b},{}],36:[function(c,a,d){'use strict';function b(d,a,e,c){var b=a.filename&&a.filename.match(/[^.a-zA-Z0-9-]/);b&&a.warn('Do not use `'+b[0]+'` in a file name'),c()}a.exports=b},{}],37:[function(c,a,d){'use strict';function b(d,b,e,c){var a=b.filename;a&&!(a===a.toLowerCase()||a===a.toUpperCase())&&b.warn('Do not mix casing in file names'),c()}a.exports=b},{}],38:[function(c,a,d){'use strict';function b(c,a,d,b){a.filename&&/^-|-$/.test(a.filename)&&a.warn('Do not use initial or final dashes in a file name'),b()}a.exports=b},{}],39:[function(c,i,j){'use strict';function h(i,c,k,j){var h=c.toString();f(i,'heading',function(i){var n=i.depth,k=i.children,l=g(i,'atx'),m,o,f,p,j;if(b.generated(i))return;if(l==='atx'||l==='atx-closed'){m=a(i),j=m.offset;while(h.charAt(j)!=='#')j++;j=n+(j-m.offset),f=a(k[0]).column-m.column-1-j,f&&(p=f>0?'Remove':'Add',f=Math.abs(f),c.warn(p+' '+f+' '+e('space',f)+' before this heading’s content',a(k[0])))}l==='atx-closed'&&(o=d(k[k.length-1]),f=d(i).column-o.column-1-n,f&&c.warn('Remove '+f+' '+e('space',f)+' after this heading’s content',o))}),j()}var f=c('unist-util-visit'),g=c('mdast-util-heading-style'),e=c('plur'),b=c('mdast-util-position'),a=b.start,d=b.end;i.exports=h},{'mdast-util-heading-style':61,'mdast-util-position':62,plur:65,'unist-util-visit':66}],40:[function(a,f,h){'use strict';function g(h,f,j,i){var a=f.toString(),g=a.length;c(h,'heading',function(l){var h=e(l),j=h.offset,i=j-1,k,c;if(b.generated(l))return;while(++i1&&b.warn('Do not indent table rows',c)})}),e()}var c=b('unist-util-visit'),a=b('mdast-util-position');d.exports=e},{'mdast-util-position':62,'unist-util-visit':66}],51:[function(c,a,d){'use strict';function b(f,b,g,e){var c=b.toString(),a=-1,d=c.length;while(++ac)return{line:b+1,column:c-(a[b-1]||0)+1};return{}}return b}function h(i,c){var e=String(c).split('\n'),h;if(!c||typeof c.contents!=='string')throw new Error('Missing `file` for mdast-range');e=d(e),h=f(e),c.offsetToPosition=g(e),c.positionToOffset=h,b(i,function(c){var b=c.position;b&&b.start&&a(b.start,h),b&&b.end&&a(b.end,h)})}function i(){return h}var b=e('unist-util-visit');c.exports=i},{'unist-util-visit':66}],61:[function(d,b,e){'use strict';function a(b,a){return b<3?'atx':a==='atx'||a==='setext'?a:null}function c(b,g){var c=b.children[b.children.length-1],d=b.depth,e=b&&b.position&&b.position.end,f=c&&c.position&&c.position.end;return e?c?f.line+1===e.line?'setext':f.column+d'+'\\s*'+')')}function f(b){var a={};return b.replace(e,function(g,c,d,e,f){var b=d||e||f||'';return b==='true'||b===''?b=!0:b==='false'?b=!1:isNaN(b)||(b=Number(b)),a[c]=b,''}),a}function a(a,b){function e(e,i){var g=e.value,c,h;return e.type!=='html'?null:(c=g.match(d),!c||c[1].length!==g.length||c[2]!==a.name?null:(h={type:c[3]||'marker',attributes:c[4]||'',parameters:f(c[4]||''),node:e},b&&b(h,i),h))}var c=a.name,d=g(c);return e}function b(e,b){var c=b.onparse,d=a(b,function(a,b){a.type==='marker'&&c(a,b)});return function(){var a=e.apply(this,arguments);return d(a,this),a}}function i(e,b){var c=b.onstringify,d=a(b,function(a,b){a.type==='marker'&&c(a,b)});return function(a){return d(a,this),e.apply(this,arguments)}}function j(i){function l(l,i,m){var a=k(l),d=a&&a.type;e&&m===e&&(d==='start'&&f++,d==='end'&&f--,d==='end'&&f===0?(b=j(g,b,a,{start:i-b.length-1,end:i,parent:e}),b&&c.apply(e.children,[h,i+1].concat(b)),g=null,e=null,h=null,b=[]):b.push(l)),!e&&d==='start'&&(f=1,h=i,g=a,e=m)}var j=i.onrun,k=a(i),b=[],g=null,e=null,f=0,h;return function(a){d(a,l)}}function k(c,a){var d=c.Parser.prototype.blockTokenizers,e=c.Parser.prototype.inlineTokenizers,f=c.Compiler.prototype;return a.onparse&&(d.html=b(d.html,a),e.tag=b(e.tag,a)),a.onstringify&&(f.html=i(f.html,a)),a.onrun?j(a):null}function l(a){if(!(a&&a.name))throw new Error('Missing `name` in `options`');return function(b){return k(b,a)}}var d=h('unist-util-visit'),c=[].splice,e=new RegExp('\\s*([-a-z09_]+)(?:=(?:"((?:\\\\[\\s\\S]|[^"])+)"|\'((?:\\\\[\\s\\S]|[^\'])+)\'|((?:\\\\[\\s\\S]|[^"\'\\s])+)))?\\s*','gi');m.exports=l},{'unist-util-visit':66}],65:[function(b,a,c){'use strict';a.exports=function(a,b,c){return typeof b==='number'&&(c=b,b=(a.replace(/(?:s|x|z|ch|sh)$/i,'$&e').replace(/y$/i,'ie')+'s').replace(/i?e?s$/i,function(b){var c=a.slice(-1)===a.slice(-1).toLowerCase();return c?b.toLowerCase():b.toUpperCase()})),c===1?a:b}},{}],66:[function(e,a,f){'use strict';function b(b,d){var a=-1,c=b.length;while(++ac)if(d(b[a],a)===!1)return!1;return!0}function d(i,a,d,f){var g,e,h;typeof a==='function'&&(f=d,d=a,a=null),g=f?c:b,h=function(a,b){return g(a,function(a,c){return a&&e(a,c,b)})},e=function(b,c,f){var e;return c=c||(f?0:null),(!a||b.type===a)&&(e=d(b,c,f||null)),b.children&&e!==!1?h(b.children,b):e},e(i)}a.exports=d},{}],67:[function(e,b,f){'use strict';function a(b,c,a){return(b[a]||0)-(c[a]||0)}function c(b,c){return a(b,c,'line')||a(b,c,'column')||-1}function d(a){return a.messages.sort(c),a}b.exports=d},{}]},{},[1])(1)}) +!function(b,a){typeof exports==='object'&&typeof module!=='undefined'?module.exports=b():typeof define==='function'&&define.amd?define([],b):(typeof window!=='undefined'?a=window:typeof global!=='undefined'?a=global:typeof self!=='undefined'?a=self:a=this,a.mdastLint=b())}(function(){return function a(b,c,e){function f(d,k){if(!c[d]){if(!b[d]){var i=typeof require=='function'&&require;if(!k&&i)return i(d,!0);if(g)return g(d,!0);var j=new Error("Cannot find module '"+d+"'");throw j.code='MODULE_NOT_FOUND',j}var h=c[d]={exports:{}};b[d][0].call(h.exports,function(c){var a=b[d][1][c];return f(a?a:c)},h,h.exports,a,b,c,e)}return c[d].exports}var g=typeof require=='function'&&require;for(var d=0;da)return;g&&(d.push({start:e,end:a}),g=!1),e=a}var i=h.children[h.children.length-1],d=[],e=0,g=!1,j=b.namespace('mdast-lint').ranges;if(!(b&&b.messages&&b.messages.length))return;c(h,function(b){var c=a.start(b),d=a.end(b);f(c&&c.offset),b.children||f(d&&d.offset)}),e===a.end(i).offset&&(f(),f(b.toString().length-1)),b.messages=b.messages.filter(function(a){var e=j[a.ruleId],g=e&&e.length,f=d.length,i=-1,h,c;a.line||(a.line=1),a.column||(a.column=1),h=b.positionToOffset(a);while(f--)if(d[f].start<=h&&d[f].end>h)return!1;while(--g>i)if(c=e[g],c.position.line0?'Add':'Remove',d=Math.abs(d),d!==0&&g.warn(i+' '+d+' '+f('space',d)+' between blockquote and content',a.start(e.children[0]))):b=c(e)}),h()}var d=b('unist-util-visit'),e=b('mdast-util-to-string'),f=b('plur'),a=b('mdast-util-position');g.exports=h},{'mdast-util-position':63,'mdast-util-to-string':64,plur:66,'unist-util-visit':67}],5:[function(f,i,j){'use strict';function h(j,h,f,k){var i=h.toString();(f==='consistent'||typeof f!=='object')&&(f={}),f.unchecked||(f.unchecked=null),f.checked||(f.checked=null),f.unchecked!==null&&e[f.unchecked]!==!0&&h.fail('Invalid unchecked checkbox marker `'+f.unchecked+"`: use either `'\\t'`, or `' '`"),f.checked!==null&&g[f.checked]!==!0&&h.fail('Invalid checked checkbox marker `'+f.checked+"`: use either `'x'`, or `'X'`"),c(j,'listItem',function(c){var e,k,n,l,g,j,m;if(c.checked!==Boolean(c.checked)||a.generated(c))return;e=c.checked?'checked':'unchecked',k=b(c).offset,n=(c.children.length?b(c.children[0]):d(c)).offset,g=i.slice(k,n).trimRight().slice(0,-1),m=g.charAt(g.length-1),j=f[e],j===null?f[e]=m:m!==j&&(l=k+g.length,h.warn(e.charAt(0).toUpperCase()+e.slice(1)+' checkboxes should use `'+j+'` as a marker',{start:h.offsetToPosition(l-1),end:h.offsetToPosition(l)}))}),k()}var c=f('unist-util-visit'),a=f('mdast-util-position'),b=a.start,d=a.end,g={x:!0,X:!0},e={' ':!0,' ':!0};i.exports=h},{'mdast-util-position':63,'unist-util-visit':67}],6:[function(c,f,h){'use strict';function g(g,c,i,h){var f=c.toString();d(g,'listItem',function(d){var i,g,h;if(d.checked!==Boolean(d.checked)||a.generated(d))return;i=b(d).offset,g=(d.children.length?b(d.children[0]):e(d)).offset;while(/[^\S\n]/.test(f.charAt(g)))g++;if(h=f.slice(i,g),h=h.slice(h.indexOf(']')+1),h.length===1)return;c.warn('Checkboxes should be followed by a single character',{start:c.offsetToPosition(g-h.length+1),end:c.offsetToPosition(g)})}),h()}var d=c('unist-util-visit'),a=c('mdast-util-position'),b=a.start,e=a.end;f.exports=g},{'mdast-util-position':63,'unist-util-visit':67}],7:[function(b,g,i){'use strict';function h(i,g,b,j){function k(b){var c=d(b).offset,f=e(b).offset;return a.generated(b)?null:b.lang||/^\s*([~`])\1{2,}/.test(h.slice(c,f))?'fenced':'indented'}var h=g.toString();if(b=typeof b!=='string'||b==='consistent'?null:b,f[b]!==!0){g.fail('Invalid code block style `'+b+"`: use either `'consistent'`, `'fenced'`, or `'indented'`");return}c(i,'code',function(c){var a=k(c);if(!a)return;b?b!==a&&g.warn('Code blocks should be '+b,c):b=a}),j()}var c=b('unist-util-visit'),a=b('mdast-util-position'),d=a.start,e=a.end,f={null:!0,fenced:!0,indented:!0};g.exports=h},{'mdast-util-position':63,'unist-util-visit':67}],8:[function(c,e,g){'use strict';function f(c,e,i,h){function f(b){var f=a.start(b).offset,h=a.end(b).offset,c;if(a.generated(b))return;c=g.slice(f,h).match(d)[1],c!==c.toLowerCase()&&e.warn('Do not use upper-case characters in definition labels',b)}var g=e.toString();b(c,'definition',f),b(c,'footnoteDefinition',f),h()}var b=c('unist-util-visit'),a=c('mdast-util-position'),d=/^\s*\[((?:\\[\s\S]|[^\[\]])+)\]/;e.exports=f},{'mdast-util-position':63,'unist-util-visit':67}],9:[function(c,e,g){'use strict';function f(c,e,i,h){function f(b){var c=a.start(b).offset,f=a.end(b).offset,h;if(a.generated(b))return;h=g.slice(c,f).match(d)[1],/[ \t\n]{2,}/.test(h)&&e.warn('Do not use consecutive white-space in definition labels',b)}var g=e.toString();b(c,'definition',f),b(c,'footnoteDefinition',f),h()}var b=c('unist-util-visit'),a=c('mdast-util-position'),d=/^\s*\[((?:\\[\s\S]|[^\[\]])+)\]/;e.exports=f},{'mdast-util-position':63,'unist-util-visit':67}],10:[function(b,e,g){'use strict';function f(f,e,b,g){if(b=typeof b!=='string'||b==='consistent'?null:b,d[b]!==!0){e.fail('Invalid emphasis marker `'+b+"`: use either `'consistent'`, `'*'`, or `'_'`");return}c(f,'emphasis',function(c){var d=e.toString().charAt(a.start(c).offset);if(a.generated(c))return;b?d!==b&&e.warn('Emphasis should use `'+b+'` as a marker',c):b=d}),g()}var c=b('unist-util-visit'),a=b('mdast-util-position'),d={'*':!0,_:!0,null:!0};e.exports=f},{'mdast-util-position':63,'unist-util-visit':67}],11:[function(b,f,h){'use strict';function g(j,g,b,k){var i=g.toString(),h=!1,f=[];typeof b==='object'&&!('length'in b)&&(h=Boolean(b.allowEmpty),b=b.flags),typeof b==='object'&&'length'in b&&(f=String(b).split(',')),c(j,'code',function(b){var c=i.slice(d(b).offset,e(b).offset);if(a.generated(b))return;b.lang?f.length&&f.indexOf(b.lang)===-1&&g.warn('Invalid code-language flag',b):/^\ {0,3}([~`])\1{2,}/.test(c)&&!h&&g.warn('Missing code-language flag',b)}),k()}var c=b('unist-util-visit'),a=b('mdast-util-position'),d=a.start,e=a.end;f.exports=g},{'mdast-util-position':63,'unist-util-visit':67}],12:[function(c,e,g){'use strict';function f(g,e,c,h){var f=e.toString();if(c=typeof c!=='string'||c==='consistent'?null:c,b[c]!==!0){e.fail('Invalid fenced code marker `'+c+"`: use either `'consistent'`, `` '`' ``, or `'~'`");return}d(g,'code',function(g){var d=f.substr(a.start(g).offset,4);if(a.generated(g))return;if(d=d.trimLeft().charAt(0),b[d]!==!0)return;c?d!==c&&e.warn('Fenced code should use '+c+' as a marker',g):c=d}),h()}var d=c('unist-util-visit'),a=c('mdast-util-position'),b={'`':!0,'~':!0,null:!0};e.exports=f},{'mdast-util-position':63,'unist-util-visit':67}],13:[function(c,a,d){'use strict';function b(e,c,a,d){var b=c.extension;a=typeof a==='string'?a:'md',b!==''&&b!==a&&c.warn('Invalid extension: use `'+a+'`'),d()}a.exports=b},{}],14:[function(b,e,g){'use strict';function f(e,f,h,g){var b=null;c(e,function(c){var e=d(c).line;if(c.type==='root'||a.generated(c))return;c.type==='definition'?b!==null&&b>e&&f.warn('Move definitions to the end of the file (after the node at line `'+b+'`)',c):b===null&&(b=e)},!0),g()}var c=b('unist-util-visit'),a=b('mdast-util-position'),d=a.start;e.exports=f},{'mdast-util-position':63,'unist-util-visit':67}],15:[function(c,a,d){'use strict';function b(e,c,f,d){var a=c.toString(),b=a.length-1;b>0&&a.charAt(b)!=='\n'&&c.warn('Missing newline character at end of file'),d()}a.exports=b},{}],16:[function(a,d,f){'use strict';function e(a,d,f,e){b(a,'heading',function(a){return c.generated(a)?null:(a.depth!==1&&d.warn('First heading level should be `1`',a),!1)}),e()}var b=a('unist-util-visit'),c=a('mdast-util-position');d.exports=e},{'mdast-util-position':63,'unist-util-visit':67}],17:[function(b,d,f){'use strict';function e(e,b,g,f){var d=b.toString();c(e,'break',function(c){var e=a.start(c).offset,f=a.end(c).offset;if(a.generated(c))return;d.slice(e,f).length>3&&b.warn('Use two spaces for hard line breaks',c)}),f()}var c=b('unist-util-visit'),a=b('mdast-util-position');d.exports=e},{'mdast-util-position':63,'unist-util-visit':67}],18:[function(a,d,f){'use strict';function e(d,e,g,f){var a=null;b(d,'heading',function(b){var d=b.depth;if(c.generated(b))return;a&&d>a+1&&e.warn('Heading levels should increment by one level at a time',b),a=d}),f()}var b=a('unist-util-visit'),c=a('mdast-util-position');d.exports=e},{'mdast-util-position':63,'unist-util-visit':67}],19:[function(a,f,h){'use strict';function g(f,g,a,h){a=e.indexOf(a)===-1?null:a,c(f,'heading',function(c){if(d.generated(c))return;a?b(c,a)!==a&&g.warn('Headings should use '+a,c):a=b(c,a)}),h()}var c=a('unist-util-visit'),b=a('mdast-util-heading-style'),d=a('mdast-util-position'),e=['atx','atx-closed','setext'];f.exports=g},{'mdast-util-heading-style':62,'mdast-util-position':63,'unist-util-visit':67}],20:[function(a,b,c){'use strict';b.exports={'no-auto-link-without-protocol':a('./no-auto-link-without-protocol'),'no-literal-urls':a('./no-literal-urls'),'no-consecutive-blank-lines':a('./no-consecutive-blank-lines'),'no-missing-blank-lines':a('./no-missing-blank-lines'),'blockquote-indentation':a('./blockquote-indentation'),'no-blockquote-without-caret':a('./no-blockquote-without-caret'),'code-block-style':a('./code-block-style'),'checkbox-content-indent':a('./checkbox-content-indent'),'checkbox-character-style':a('./checkbox-character-style'),'definition-case':a('./definition-case'),'definition-spacing':a('./definition-spacing'),'no-emphasis-as-heading':a('./no-emphasis-as-heading'),'emphasis-marker':a('./emphasis-marker'),'fenced-code-flag':a('./fenced-code-flag'),'fenced-code-marker':a('./fenced-code-marker'),'file-extension':a('./file-extension'),'final-newline':a('./final-newline'),'no-file-name-articles':a('./no-file-name-articles'),'no-file-name-consecutive-dashes':a('./no-file-name-consecutive-dashes'),'no-file-name-irregular-characters':a('./no-file-name-irregular-characters'),'no-file-name-mixed-case':a('./no-file-name-mixed-case'),'no-file-name-outer-dashes':a('./no-file-name-outer-dashes'),'final-definition':a('./final-definition'),'hard-break-spaces':a('./hard-break-spaces'),'heading-increment':a('./heading-increment'),'no-heading-content-indent':a('./no-heading-content-indent'),'no-heading-indent':a('./no-heading-indent'),'first-heading-level':a('./first-heading-level'),'maximum-heading-length':a('./maximum-heading-length'),'no-heading-punctuation':a('./no-heading-punctuation'),'heading-style':a('./heading-style'),'no-multiple-toplevel-headings':a('./no-multiple-toplevel-headings'),'no-duplicate-headings':a('./no-duplicate-headings'),'no-duplicate-definitions':a('./no-duplicate-definitions'),'no-html':a('./no-html'),'no-inline-padding':a('./no-inline-padding'),'maximum-line-length':a('./maximum-line-length'),'link-title-style':a('./link-title-style'),'list-item-bullet-indent':a('./list-item-bullet-indent'),'list-item-content-indent':a('./list-item-content-indent'),'list-item-indent':a('./list-item-indent'),'list-item-spacing':a('./list-item-spacing'),'ordered-list-marker-style':a('./ordered-list-marker-style'),'ordered-list-marker-value':a('./ordered-list-marker-value'),'no-shortcut-reference-image':a('./no-shortcut-reference-image'),'no-shortcut-reference-link':a('./no-shortcut-reference-link'),'rule-style':a('./rule-style'),'no-shell-dollars':a('./no-shell-dollars'),'strong-marker':a('./strong-marker'),'no-table-indentation':a('./no-table-indentation'),'table-pipe-alignment':a('./table-pipe-alignment'),'table-cell-padding':a('./table-cell-padding'),'table-pipes':a('./table-pipes'),'no-tabs':a('./no-tabs'),'unordered-list-marker-style':a('./unordered-list-marker-style')}},{'./blockquote-indentation':4,'./checkbox-character-style':5,'./checkbox-content-indent':6,'./code-block-style':7,'./definition-case':8,'./definition-spacing':9,'./emphasis-marker':10,'./fenced-code-flag':11,'./fenced-code-marker':12,'./file-extension':13,'./final-definition':14,'./final-newline':15,'./first-heading-level':16,'./hard-break-spaces':17,'./heading-increment':18,'./heading-style':19,'./link-title-style':21,'./list-item-bullet-indent':22,'./list-item-content-indent':23,'./list-item-indent':24,'./list-item-spacing':25,'./maximum-heading-length':26,'./maximum-line-length':27,'./no-auto-link-without-protocol':28,'./no-blockquote-without-caret':29,'./no-consecutive-blank-lines':30,'./no-duplicate-definitions':31,'./no-duplicate-headings':32,'./no-emphasis-as-heading':33,'./no-file-name-articles':34,'./no-file-name-consecutive-dashes':35,'./no-file-name-irregular-characters':36,'./no-file-name-mixed-case':37,'./no-file-name-outer-dashes':38,'./no-heading-content-indent':39,'./no-heading-indent':40,'./no-heading-punctuation':41,'./no-html':42,'./no-inline-padding':43,'./no-literal-urls':44,'./no-missing-blank-lines':45,'./no-multiple-toplevel-headings':46,'./no-shell-dollars':47,'./no-shortcut-reference-image':48,'./no-shortcut-reference-link':49,'./no-table-indentation':50,'./no-tabs':51,'./ordered-list-marker-style':52,'./ordered-list-marker-value':53,'./rule-style':54,'./strong-marker':55,'./table-cell-padding':56,'./table-pipe-alignment':57,'./table-pipes':58,'./unordered-list-marker-style':59}],21:[function(d,f,h){'use strict';function g(g,f,d,j){function h(h){var a=e(h).offset-1,g,j;if(b.generated(h))return;h.type!=='definition'&&a--;while(a){if(g=i.charAt(a),!/\s/.test(g))break;a--}if(!(g in c))return;d?d!==g&&(j=f.offsetToPosition(a+1),f.warn(d===')'?'Titles should use `()` as a quote':'Titles should use `'+d+'` as a quote',j)):d=g}var i=f.toString();if(d=typeof d!=='string'||d==='consistent'?null:d,(d==='()'||d==='(')&&(d=')'),c[d]!==!0){f.fail('Invalid link title style marker `'+d+"`: use either `'consistent'`, `'\"'`, `'\\''`, or `'()'`");return}a(g,'link',h),a(g,'image',h),a(g,'definition',h),j()}var a=d('unist-util-visit'),b=d('mdast-util-position'),c={'"':!0,"'":!0,')':!0,null:!0},e=b.end;f.exports=g},{'mdast-util-position':63,'unist-util-visit':67}],22:[function(b,f,h){'use strict';function g(g,b,i,h){var f=b.toString();d(g,'list',function(d){var g=d.children;g.forEach(function(j){var i=j.children[0],g=a(j).offset,k=a(i).offset,h;if(c.generated(d))return;h=f.slice(g,k).match(/^\s*/)[0].length,h!==0&&(g=a(i),b.warn('Incorrect indentation before bullet: remove '+h+' '+e('space',h),{line:g.line,column:g.column-h}))})}),h()}var d=b('unist-util-visit'),c=b('mdast-util-position'),e=b('plur'),a=c.start;f.exports=g},{'mdast-util-position':63,plur:66,'unist-util-visit':67}],23:[function(a,f,h){'use strict';function g(g,a,i,h){var f=a.toString();d(g,'listItem',function(d){var g;d.children.forEach(function(l,n){var j=c(l),h=j.column,k,i,m;if(b.generated(l))return;if(n===0){if(Boolean(d.checked)===d.checked){k=j.offset;while(f.charAt(k)!=='[')k--;h-=j.offset-k}g=h;return}h!==g&&(i=g-h,m=i>0?'add':'remove',i=Math.abs(i),a.warn('Don’t use mixed indentation for children, '+m+' '+i+' '+e('space',i),{line:c(l).line,column:h}))})}),h()}var d=a('unist-util-visit'),b=a('mdast-util-position'),e=a('plur'),c=b.start;f.exports=g},{'mdast-util-position':63,plur:66,'unist-util-visit':67}],24:[function(b,g,i){'use strict';function h(i,g,b,j){var h=g.toString();if(b=typeof b!=='string'?'tab-size':b,f[b]!==!0){g.fail('Invalid list-item indent style `'+b+"`: use either `'tab-size'`, `'space'`, or `'mixed'`");return}d(i,'list',function(d){var f=d.children,i=d.ordered,j=d.start||1;if(c.generated(d))return;f.forEach(function(r,s){var m=r.children[0],l=i?String(j+s).length+1:1,n=Math.ceil(l/4)*4,o=a(r).offset,p=a(m).offset,f,k,c,q;f=h.slice(o,p),f=f.replace(/\[[x ]?\]\s*$/i,''),b==='tab-size'?k=n:b==='space'?k=l+1:k=d.loose?n:l+1,f.length!==k&&(c=k-f.length,q=c>0?'add':'remove',c=Math.abs(c),g.warn('Incorrect list-item indent: '+q+' '+c+' '+e('space',c),a(m)))})}),j()}var d=b('unist-util-visit'),c=b('mdast-util-position'),e=b('plur'),a=c.start,f={'tab-size':!0,mixed:!0,space:!0};g.exports=h},{'mdast-util-position':63,plur:66,'unist-util-visit':67}],25:[function(d,f,h){'use strict';function g(d,f,h,g){e(d,'list',function(g){var d=g.children,e=!0,h=b(g).column,i;if(a.generated(g))return;d.forEach(function(h){var a=h.children,d=a[0],f=a[a.length-1],g=c(f).line-b(d).line>0;g&&(e=!1)}),i=e?'tight':'loose',d.forEach(function(g,k){var a=d[k+1],j=c(g).column>h;if(!a)return;j!==e&&f.warn('List item should be '+i+', isn’t',{start:c(g),end:b(a)})})}),g()}var e=d('unist-util-visit'),a=d('mdast-util-position'),b=a.start,c=a.end;f.exports=g},{'mdast-util-position':63,'unist-util-visit':67}],26:[function(a,e,g){'use strict';function f(e,f,a,g){a=isNaN(a)||typeof a!=='number'?60:a,b(e,'heading',function(b){if(d.generated(b))return;c(b).length>a&&f.warn('Use headings shorter than `'+a+'`',b)}),g()}var b=a('unist-util-visit'),c=a('mdast-util-to-string'),d=a('mdast-util-position');e.exports=f},{'mdast-util-position':63,'mdast-util-to-string':64,'unist-util-visit':67}],27:[function(e,f,i){'use strict';function g(a){return a.type==='heading'||a.type==='table'||a.type==='code'||a.type==='definition'}function h(k,l,j,q){function p(a,b){a--;while(++ae||h.columne&&l.warn('Line must be at most '+e+' characters',{line:h+1,column:i+1});q()}var b=e('unist-util-visit'),a=e('mdast-util-position'),c=a.start,d=a.end;f.exports=h},{'mdast-util-position':63,'unist-util-visit':67}],28:[function(d,j,k){'use strict';function i(a){return g.test(f(a))}function h(d,f,h,g){e(d,'link',function(d){var e=c(d.children[0]).column,g=b(d.children[d.children.length-1]).column,h=c(d).column,j=b(d).column;if(a.generated(d))return;h===e-1&&j===g+1&&!i(d)&&f.warn('All automatic links must start with a protocol',d)}),g()}var e=d('unist-util-visit'),f=d('mdast-util-to-string'),a=d('mdast-util-position'),c=a.start,b=a.end,g=/^[a-z][a-z+.-]+:\/?/i;j.exports=h},{'mdast-util-position':63,'mdast-util-to-string':64,'unist-util-visit':67}],29:[function(b,d,f){'use strict';function e(f,b,h,g){var d=b.toString(),e=d.length;c(f,'blockquote',function(c){var g=a.start(c).line,f=c.position&&c.position.indent;if(a.generated(c)||!f||!f.length)return;f.forEach(function(h,i){var a,c=g+i+1,f=b.positionToOffset({line:c,column:h})-1;while(++f')return;if(a!==' '&&a!==' ')break}b.warn('Missing caret in blockquote',{line:c,column:h})})}),g()}var c=b('unist-util-visit'),a=b('mdast-util-position');d.exports=e},{'mdast-util-position':63,'unist-util-visit':67}],30:[function(b,f,h){'use strict';function g(f,g,i,h){function b(e,b,f){var a=b.line-e.line,c=a>0?'before':'after';a=Math.abs(a)-f,a>0&&g.warn('Remove '+a+' '+d('line',a)+' '+c+' node',b)}c(f,function(d){var c=d.children;if(a.generated(d))return;c&&c[0]&&(b(a.start(d),a.start(c[0]),0),c.forEach(function(f,h){var d=c[h-1],g=e;if(!d||a.generated(d)||a.generated(f))return;(d.type==='list'&&f.type==='list'||f.type==='code'&&d.type==='list'&&!f.lang)&&g++,b(a.end(d),a.start(f),g)}),b(a.end(d),a.end(c[c.length-1]),1))}),h()}var c=b('unist-util-visit'),a=b('mdast-util-position'),d=b('plur'),e=2;f.exports=g},{'mdast-util-position':63,plur:66,'unist-util-visit':67}],31:[function(c,d,f){'use strict';function e(d,f,h,g){function e(b){var d=c[b.identifier],e;if(a.generated(b))return;d&&d.type&&(e=a.start(d),f.warn('Do not use definitions with the same identifier ('+e.line+':'+e.column+')',b)),c[b.identifier]=b}var c={};b(d,'definition',e),b(d,'footnoteDefinition',e),g()}var a=c('mdast-util-position'),b=c('unist-util-visit');d.exports=e},{'mdast-util-position':63,'unist-util-visit':67}],32:[function(a,e,g){'use strict';function f(e,f,h,g){var a={};c(e,'heading',function(c){var g=d(c).toUpperCase(),e=a[g],h;if(b.generated(c))return;e&&e.type==='heading'&&(h=b.start(e),f.warn('Do not use headings with similar content ('+h.line+':'+h.column+')',c)),a[g]=c}),g()}var b=a('mdast-util-position'),c=a('unist-util-visit'),d=a('mdast-util-to-string');e.exports=f},{'mdast-util-position':63,'mdast-util-to-string':64,'unist-util-visit':67}],33:[function(a,e,g){'use strict';function f(a,e,g,f){b(a,'paragraph',function(b,j,k){var f=b.children,a=f[0],g=k.children[j-1],h=k.children[j+1],i;if(d.generated(b))return;(!g||g.type!=='heading')&&h&&h.type==='paragraph'&&f.length===1&&(a.type==='emphasis'||a.type==='strong')&&(i=c(a),i.charAt(i.length-1)===':'&&e.warn('Don’t use emphasis to introduce a section, use a heading',b))}),f()}var b=a('unist-util-visit'),c=a('mdast-util-to-string'),d=a('mdast-util-position');e.exports=f},{'mdast-util-position':63,'mdast-util-to-string':64,'unist-util-visit':67}],34:[function(c,a,d){'use strict';function b(d,a,e,c){var b=a.filename&&a.filename.match(/^(the|an?)\b/i);b&&a.warn('Do not start file names with `'+b[0]+'`'),c()}a.exports=b},{}],35:[function(c,a,d){'use strict';function b(c,a,d,b){a.filename&&/-{2,}/.test(a.filename)&&a.warn('Do not use consecutive dashes in a file name'),b()}a.exports=b},{}],36:[function(c,a,d){'use strict';function b(d,a,e,c){var b=a.filename&&a.filename.match(/[^.a-zA-Z0-9-]/);b&&a.warn('Do not use `'+b[0]+'` in a file name'),c()}a.exports=b},{}],37:[function(c,a,d){'use strict';function b(d,b,e,c){var a=b.filename;a&&!(a===a.toLowerCase()||a===a.toUpperCase())&&b.warn('Do not mix casing in file names'),c()}a.exports=b},{}],38:[function(c,a,d){'use strict';function b(c,a,d,b){a.filename&&/^-|-$/.test(a.filename)&&a.warn('Do not use initial or final dashes in a file name'),b()}a.exports=b},{}],39:[function(c,i,j){'use strict';function h(i,c,k,j){var h=c.toString();f(i,'heading',function(i){var n=i.depth,k=i.children,l=g(i,'atx'),m,o,f,p,j;if(b.generated(i))return;if(l==='atx'||l==='atx-closed'){m=a(i),j=m.offset;while(h.charAt(j)!=='#')j++;j=n+(j-m.offset),f=a(k[0]).column-m.column-1-j,f&&(p=f>0?'Remove':'Add',f=Math.abs(f),c.warn(p+' '+f+' '+e('space',f)+' before this heading’s content',a(k[0])))}l==='atx-closed'&&(o=d(k[k.length-1]),f=d(i).column-o.column-1-n,f&&c.warn('Remove '+f+' '+e('space',f)+' after this heading’s content',o))}),j()}var f=c('unist-util-visit'),g=c('mdast-util-heading-style'),e=c('plur'),b=c('mdast-util-position'),a=b.start,d=b.end;i.exports=h},{'mdast-util-heading-style':62,'mdast-util-position':63,plur:66,'unist-util-visit':67}],40:[function(a,f,h){'use strict';function g(h,f,j,i){var a=f.toString(),g=a.length;c(h,'heading',function(l){var h=e(l),j=h.offset,i=j-1,k,c;if(b.generated(l))return;while(++i1&&b.warn('Do not indent table rows',c)})}),e()}var c=b('unist-util-visit'),a=b('mdast-util-position');d.exports=e},{'mdast-util-position':63,'unist-util-visit':67}],51:[function(c,a,d){'use strict';function b(f,b,g,e){var c=b.toString(),a=-1,d=c.length;while(++ac)return{line:b+1,column:c-(a[b-1]||0)+1};return{}}return b}function h(i,c){var e=String(c).split('\n'),h;if(!c||typeof c.contents!=='string')throw new Error('Missing `file` for mdast-range');e=d(e),h=f(e),c.offsetToPosition=g(e),c.positionToOffset=h,b(i,function(c){var b=c.position;b&&b.start&&a(b.start,h),b&&b.end&&a(b.end,h)})}function i(){return h}var b=e('unist-util-visit');c.exports=i},{'unist-util-visit':67}],62:[function(d,b,e){'use strict';function a(b,a){return b<3?'atx':a==='atx'||a==='setext'?a:null}function c(b,g){var c=b.children[b.children.length-1],d=b.depth,e=b&&b.position&&b.position.end,f=c&&c.position&&c.position.end;return e?c?f.line+1===e.line?'setext':f.column+d'+'\\s*'+')')}function f(b){var a={};return b.replace(e,function(g,c,d,e,f){var b=d||e||f||'';return b==='true'||b===''?b=!0:b==='false'?b=!1:isNaN(b)||(b=Number(b)),a[c]=b,''}),a}function a(a,b){function e(e,i){var g=e.value,c,h;return e.type!=='html'?null:(c=g.match(d),!c||c[1].length!==g.length||c[2]!==a.name?null:(h={type:c[3]||'marker',attributes:c[4]||'',parameters:f(c[4]||''),node:e},b&&b(h,i),h))}var c=a.name,d=g(c);return e}function b(e,b){var c=b.onparse,d=a(b,function(a,b){a.type==='marker'&&c(a,b)});return function(){var a=e.apply(this,arguments);return d(a,this),a}}function i(e,b){var c=b.onstringify,d=a(b,function(a,b){a.type==='marker'&&c(a,b)});return function(a){return d(a,this),e.apply(this,arguments)}}function j(i){function l(l,i,m){var a=k(l),d=a&&a.type;e&&m===e&&(d==='start'&&f++,d==='end'&&f--,d==='end'&&f===0?(b=j(g,b,a,{start:i-b.length-1,end:i,parent:e}),b&&c.apply(e.children,[h,i+1].concat(b)),g=null,e=null,h=null,b=[]):b.push(l)),!e&&d==='start'&&(f=1,h=i,g=a,e=m)}var j=i.onrun,k=a(i),b=[],g=null,e=null,f=0,h;return function(a){d(a,l)}}function k(c,a){var d=c.Parser.prototype.blockTokenizers,e=c.Parser.prototype.inlineTokenizers,f=c.Compiler.prototype;return a.onparse&&(d.html=b(d.html,a),e.tag=b(e.tag,a)),a.onstringify&&(f.html=i(f.html,a)),a.onrun?j(a):null}function l(a){if(!(a&&a.name))throw new Error('Missing `name` in `options`');return function(b){return k(b,a)}}var d=h('unist-util-visit'),c=[].splice,e=new RegExp('\\s*([-a-z09_]+)(?:=(?:"((?:\\\\[\\s\\S]|[^"])+)"|\'((?:\\\\[\\s\\S]|[^\'])+)\'|((?:\\\\[\\s\\S]|[^"\'\\s])+)))?\\s*','gi');m.exports=l},{'unist-util-visit':67}],66:[function(b,a,c){'use strict';a.exports=function(a,b,c){return typeof b==='number'&&(c=b,b=(a.replace(/(?:s|x|z|ch|sh)$/i,'$&e').replace(/y$/i,'ie')+'s').replace(/i?e?s$/i,function(b){var c=a.slice(-1)===a.slice(-1).toLowerCase();return c?b.toLowerCase():b.toUpperCase()})),c===1?a:b}},{}],67:[function(e,a,f){'use strict';function b(b,d){var a=-1,c=b.length;while(++ac)if(d(b[a],a)===!1)return!1;return!0}function d(i,a,d,f){var g,e,h;typeof a==='function'&&(f=d,d=a,a=null),g=f?c:b,h=function(a,b){return g(a,function(a,c){return a&&e(a,c,b)})},e=function(b,c,f){var e;return c=c||(f?0:null),(!a||b.type===a)&&(e=d(b,c,f||null)),b.children&&e!==!1?h(b.children,b):e},e(i)}a.exports=d},{}],68:[function(e,b,f){'use strict';function a(b,c,a){return(b[a]||0)-(c[a]||0)}function c(b,c){return a(b,c,'line')||a(b,c,'column')||-1}function d(a){return a.messages.sort(c),a}b.exports=d},{}]},{},[1])(1)}) diff --git a/package.json b/package.json index bdcd22b9..cde98e42 100644 --- a/package.json +++ b/package.json @@ -12,6 +12,7 @@ "repository": "wooorm/mdast-lint", "author": "Titus Wormer ", "dependencies": { + "decamelize": "^1.0.0", "mdast-range": "^1.0.0", "mdast-util-heading-style": "^1.0.0", "mdast-util-position": "^1.0.0", diff --git a/test/index.js b/test/index.js index 3836eedf..c9ef18ef 100644 --- a/test/index.js +++ b/test/index.js @@ -29,6 +29,7 @@ var join = path.join; var basename = path.basename; var extname = path.extname; var dirname = path.dirname; +var dequal = assert.deepEqual; /** * Create a `File` from a `filePath`. @@ -206,6 +207,17 @@ describe('mdast-lint', function () { 'file-extension': 'md' }).length === 1); }); + + it('should accept camel-cased rules', function () { + dequal(process('maximum-line-length-valid.md', { + 'reset': true, + 'maximumLineLength': 20 + }).map(String), [ + 'maximum-line-length-valid.md:1:81: Line must be at most 20 characters', + 'maximum-line-length-valid.md:18:61: Line must be at most 20 characters', + 'maximum-line-length-valid.md:22:40: Line must be at most 20 characters' + ]); + }); }); /*