diff --git a/doc/rules.md b/doc/rules.md index a8a34bee..b7baf937 100644 --- a/doc/rules.md +++ b/doc/rules.md @@ -661,7 +661,7 @@ Options: `boolean`, default: `false`. Options: `number`, default: `80`. Ignores nodes which cannot be wrapped, such as heasings, tables, - code, link, and images. + code, link, images, and definitions. ### no-auto-link-without-protocol diff --git a/lib/rules/maximum-line-length.js b/lib/rules/maximum-line-length.js index b59b2a03..7cc62b7b 100644 --- a/lib/rules/maximum-line-length.js +++ b/lib/rules/maximum-line-length.js @@ -8,7 +8,7 @@ * Options: `number`, default: `80`. * * Ignores nodes which cannot be wrapped, such as heasings, tables, - * code, link, and images. + * code, link, images, and definitions. * @example * * Alpha bravo charlie delta echo. @@ -53,10 +53,11 @@ var end = position.end; * @return {boolean} - Whether or not `node` should be * ignored. */ -function isApplicable(node) { +function isIgnored(node) { return node.type === 'heading' || node.type === 'table' || - node.type === 'code'; + node.type === 'code' || + node.type === 'definition'; } /** @@ -96,7 +97,7 @@ function maximumLineLength(ast, file, preferred, done) { */ visit(ast, function (node) { - var applicable = isApplicable(node); + var applicable = isIgnored(node); var initial = applicable && start(node).line; var final = applicable && end(node).line; diff --git a/mdast-lint.js b/mdast-lint.js index 29380276..493d67f6 100644 --- a/mdast-lint.js +++ b/mdast-lint.js @@ -2654,7 +2654,7 @@ module.exports = maximumHeadingLength; * Options: `number`, default: `80`. * * Ignores nodes which cannot be wrapped, such as heasings, tables, - * code, link, and images. + * code, link, images, and definitions. * @example * * Alpha bravo charlie delta echo. @@ -2699,10 +2699,11 @@ var end = position.end; * @return {boolean} - Whether or not `node` should be * ignored. */ -function isApplicable(node) { +function isIgnored(node) { return node.type === 'heading' || node.type === 'table' || - node.type === 'code'; + node.type === 'code' || + node.type === 'definition'; } /** @@ -2742,7 +2743,7 @@ function maximumLineLength(ast, file, preferred, done) { */ visit(ast, function (node) { - var applicable = isApplicable(node); + var applicable = isIgnored(node); var initial = applicable && start(node).line; var final = applicable && end(node).line; diff --git a/mdast-lint.min.js b/mdast-lint.min.js index 796a57a8..b9922d57 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;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=b.lintRanges[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('mdast-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,'mdast-util-visit':65,plur: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('mdast-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,'mdast-util-visit':65}],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('mdast-util-visit'),a=c('mdast-util-position'),b=a.start,e=a.end;f.exports=g},{'mdast-util-position':63,'mdast-util-visit':65}],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('mdast-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,'mdast-util-visit':65}],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 uppper-case characters in definition labels',b)}var g=e.toString();b(c,'definition',f),b(c,'footnoteDefinition',f),h()}var b=c('mdast-util-visit'),a=c('mdast-util-position'),d=/^\s*\[((?:\\[\s\S]|[^\[\]])+)\]/;e.exports=f},{'mdast-util-position':63,'mdast-util-visit':65}],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('mdast-util-visit'),a=c('mdast-util-position'),d=/^\s*\[((?:\\[\s\S]|[^\[\]])+)\]/;e.exports=f},{'mdast-util-position':63,'mdast-util-visit':65}],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('mdast-util-visit'),a=b('mdast-util-position'),d={'*':!0,_:!0,null:!0};e.exports=f},{'mdast-util-position':63,'mdast-util-visit':65}],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('mdast-util-visit'),a=b('mdast-util-position'),d=a.start,e=a.end;f.exports=g},{'mdast-util-position':63,'mdast-util-visit':65}],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('mdast-util-visit'),a=c('mdast-util-position'),b={'`':!0,'~':!0,null:!0};e.exports=f},{'mdast-util-position':63,'mdast-util-visit':65}],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('mdast-util-visit'),a=b('mdast-util-position'),d=a.start;e.exports=f},{'mdast-util-position':63,'mdast-util-visit':65}],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('mdast-util-visit'),c=a('mdast-util-position');d.exports=e},{'mdast-util-position':63,'mdast-util-visit':65}],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('mdast-util-visit'),a=b('mdast-util-position');d.exports=e},{'mdast-util-position':63,'mdast-util-visit':65}],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('mdast-util-visit'),c=a('mdast-util-position');d.exports=e},{'mdast-util-position':63,'mdast-util-visit':65}],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('mdast-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,'mdast-util-visit':65}],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('mdast-util-visit'),b=d('mdast-util-position'),c={'"':!0,"'":!0,')':!0,null:!0},e=b.end;f.exports=g},{'mdast-util-position':63,'mdast-util-visit':65}],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('mdast-util-visit'),c=b('mdast-util-position'),e=b('plur'),a=c.start;f.exports=g},{'mdast-util-position':63,'mdast-util-visit':65,plur: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('mdast-util-visit'),b=a('mdast-util-position'),e=a('plur'),c=b.start;f.exports=g},{'mdast-util-position':63,'mdast-util-visit':65,plur: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('mdast-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,'mdast-util-visit':65,plur: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('mdast-util-visit'),a=d('mdast-util-position'),b=a.start,c=a.end;f.exports=g},{'mdast-util-position':63,'mdast-util-visit':65}],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('mdast-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,'mdast-util-visit':65}],27:[function(e,f,i){'use strict';function g(a){return a.type==='heading'||a.type==='table'||a.type==='code'}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('mdast-util-visit'),a=e('mdast-util-position'),c=a.start,d=a.end;f.exports=h},{'mdast-util-position':63,'mdast-util-visit':65}],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('mdast-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,'mdast-util-visit':65}],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('mdast-util-visit'),a=b('mdast-util-position');d.exports=e},{'mdast-util-position':63,'mdast-util-visit':65}],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('mdast-util-visit'),a=b('mdast-util-position'),d=b('plur'),e=2;f.exports=g},{'mdast-util-position':63,'mdast-util-visit':65,plur: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('mdast-util-visit');d.exports=e},{'mdast-util-position':63,'mdast-util-visit':65}],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('mdast-util-visit'),d=a('mdast-util-to-string');e.exports=f},{'mdast-util-position':63,'mdast-util-to-string':64,'mdast-util-visit':65}],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('mdast-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,'mdast-util-visit':65}],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('mdast-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,'mdast-util-visit':65,plur: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('mdast-util-visit'),a=b('mdast-util-position');d.exports=e},{'mdast-util-position':63,'mdast-util-visit':65}],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('mdast-util-visit');c.exports=i},{'mdast-util-visit':65}],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+dc)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},{}],66:[function(h,m,n){'use strict';function g(a){return new RegExp('(\\s*'+'\\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('mdast-util-visit'),c=[].splice,e=new RegExp('\\s*([-a-z09_]+)(?:=(?:"((?:\\\\[\\s\\S]|[^"])+)"|\'((?:\\\\[\\s\\S]|[^\'])+)\'|((?:\\\\[\\s\\S]|[^"\'\\s])+)))?\\s*','gi');m.exports=l},{'mdast-util-visit':65}],67:[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}},{}]},{},[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;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=b.lintRanges[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('mdast-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,'mdast-util-visit':65,plur: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('mdast-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,'mdast-util-visit':65}],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('mdast-util-visit'),a=c('mdast-util-position'),b=a.start,e=a.end;f.exports=g},{'mdast-util-position':63,'mdast-util-visit':65}],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('mdast-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,'mdast-util-visit':65}],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 uppper-case characters in definition labels',b)}var g=e.toString();b(c,'definition',f),b(c,'footnoteDefinition',f),h()}var b=c('mdast-util-visit'),a=c('mdast-util-position'),d=/^\s*\[((?:\\[\s\S]|[^\[\]])+)\]/;e.exports=f},{'mdast-util-position':63,'mdast-util-visit':65}],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('mdast-util-visit'),a=c('mdast-util-position'),d=/^\s*\[((?:\\[\s\S]|[^\[\]])+)\]/;e.exports=f},{'mdast-util-position':63,'mdast-util-visit':65}],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('mdast-util-visit'),a=b('mdast-util-position'),d={'*':!0,_:!0,null:!0};e.exports=f},{'mdast-util-position':63,'mdast-util-visit':65}],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('mdast-util-visit'),a=b('mdast-util-position'),d=a.start,e=a.end;f.exports=g},{'mdast-util-position':63,'mdast-util-visit':65}],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('mdast-util-visit'),a=c('mdast-util-position'),b={'`':!0,'~':!0,null:!0};e.exports=f},{'mdast-util-position':63,'mdast-util-visit':65}],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('mdast-util-visit'),a=b('mdast-util-position'),d=a.start;e.exports=f},{'mdast-util-position':63,'mdast-util-visit':65}],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('mdast-util-visit'),c=a('mdast-util-position');d.exports=e},{'mdast-util-position':63,'mdast-util-visit':65}],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('mdast-util-visit'),a=b('mdast-util-position');d.exports=e},{'mdast-util-position':63,'mdast-util-visit':65}],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('mdast-util-visit'),c=a('mdast-util-position');d.exports=e},{'mdast-util-position':63,'mdast-util-visit':65}],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('mdast-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,'mdast-util-visit':65}],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('mdast-util-visit'),b=d('mdast-util-position'),c={'"':!0,"'":!0,')':!0,null:!0},e=b.end;f.exports=g},{'mdast-util-position':63,'mdast-util-visit':65}],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('mdast-util-visit'),c=b('mdast-util-position'),e=b('plur'),a=c.start;f.exports=g},{'mdast-util-position':63,'mdast-util-visit':65,plur: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('mdast-util-visit'),b=a('mdast-util-position'),e=a('plur'),c=b.start;f.exports=g},{'mdast-util-position':63,'mdast-util-visit':65,plur: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('mdast-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,'mdast-util-visit':65,plur: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('mdast-util-visit'),a=d('mdast-util-position'),b=a.start,c=a.end;f.exports=g},{'mdast-util-position':63,'mdast-util-visit':65}],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('mdast-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,'mdast-util-visit':65}],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('mdast-util-visit'),a=e('mdast-util-position'),c=a.start,d=a.end;f.exports=h},{'mdast-util-position':63,'mdast-util-visit':65}],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('mdast-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,'mdast-util-visit':65}],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('mdast-util-visit'),a=b('mdast-util-position');d.exports=e},{'mdast-util-position':63,'mdast-util-visit':65}],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('mdast-util-visit'),a=b('mdast-util-position'),d=b('plur'),e=2;f.exports=g},{'mdast-util-position':63,'mdast-util-visit':65,plur: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('mdast-util-visit');d.exports=e},{'mdast-util-position':63,'mdast-util-visit':65}],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('mdast-util-visit'),d=a('mdast-util-to-string');e.exports=f},{'mdast-util-position':63,'mdast-util-to-string':64,'mdast-util-visit':65}],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('mdast-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,'mdast-util-visit':65}],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('mdast-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,'mdast-util-visit':65,plur: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('mdast-util-visit'),a=b('mdast-util-position');d.exports=e},{'mdast-util-position':63,'mdast-util-visit':65}],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('mdast-util-visit');c.exports=i},{'mdast-util-visit':65}],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+dc)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},{}],66:[function(h,m,n){'use strict';function g(a){return new RegExp('(\\s*'+'\\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('mdast-util-visit'),c=[].splice,e=new RegExp('\\s*([-a-z09_]+)(?:=(?:"((?:\\\\[\\s\\S]|[^"])+)"|\'((?:\\\\[\\s\\S]|[^\'])+)\'|((?:\\\\[\\s\\S]|[^"\'\\s])+)))?\\s*','gi');m.exports=l},{'mdast-util-visit':65}],67:[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}},{}]},{},[1])(1)}) diff --git a/test/fixtures/maximum-line-length-valid.md b/test/fixtures/maximum-line-length-valid.md index 58240bca..86e8b1c2 100644 --- a/test/fixtures/maximum-line-length-valid.md +++ b/test/fixtures/maximum-line-length-valid.md @@ -18,3 +18,7 @@ This is also fine: . + +In addition, definitions are also fine: + +[foo]: