mirror of
https://github.com/remarkjs/remark-lint.git
synced 2024-09-11 19:57:15 +03:00
2 lines
36 KiB
JavaScript
2 lines
36 KiB
JavaScript
!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.mdast=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;d<e.length;d++)f(e[d]);return f}({1:[function(a,b,c){'use strict';b.exports=a('./lib')},{'./lib':3}],2:[function(d,a,e){'use strict';function b(b,a){if(!(a&&a.messages&&a.messages.length))return;a.messages=a.messages.filter(function(b){var d=a.lintRanges[b.ruleId],e=d&&d.length,f=-1,c;b.line||(b.line=1),b.column||(b.column=1);while(--e>f)if(c=d[e],c.position.line<b.line||c.position.line===b.line&&c.position.column<b.column)return c.state===!0;return!0})}function c(){return b}a.exports=c},{}],3:[function(a,i,j){'use strict';function h(b,c,a){function d(){function d(e,d,f){function g(c){var a=d.messages;while(d.lintIndex<a.length)a[d.lintIndex].ruleId=b,d.lintIndex++;f(c)}(d.lintIndex===undefined||d.lintIndex===null)&&(d.lintIndex=d.messages.length),c(e,d,a,g)}return a===!1?null:d}return d}function g(a,n){function k(c,b){var a=b&&b.lintRanges&&b.lintRanges[c];return a?a[a.length-1].state:(j=g[c],j===!1?!1:!m||j!==null&&j!==undefined)}function l(d){var a=d.lintRanges,c;if(!a){a={};for(c in b)a[c]=[{state:k(c),position:{line:0,column:0}}];d.lintRanges=a}}function o(e,j){var a=j.file,f=e.attributes.split(' '),c=f[0],d=f[1],h,g,i;if(l(a),c!=='disable'&&c!=='enable'){a.fail('Unknown lint keyword `'+c+"`: use either `'enable'` or `'disable'`",e.node);return}if(!(d in b)){a.fail('Unknown rule: cannot '+c+" `'"+d+"'`",e.node);return}h=a.lintRanges[d],i=k(d,a),g=c==='enable',g!==i&&h.push({state:g,position:e.node.position.start})}var g=n||{},m=g.reset,i,j;a.use(e),a.use(function(){return function(b,a){l(a)}});for(i in b)a.use(h(i,b[i],g[i]));a.use(f({name:'lint',onparse:o})),a.use(d),a.use(c)}var e=a('mdast-range'),f=a('mdast-zone'),b=a('./rules'),d=a('./sort'),c=a('./filter');i.exports=g},{'./filter':2,'./rules':18,'./sort':58,'mdast-range':64,'mdast-zone':65}],4:[function(b,g,i){'use strict';function c(f){var b=f.children[0],c=a.start(b).column-a.start(f).column,d=e(b).match(/^ +/);return d&&(c+=d[0].length),c}function h(e,g,b,h){b=isNaN(b)||typeof b!=='number'?null:b,d(e,'blockquote',function(e){var h,d,i;if(a.isGenerated(e))return;b?(h=c(e),d=b-h,i=d>0?'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('../utilities/visit'),e=b('../utilities/to-string'),f=b('../utilities/plural'),a=b('../utilities/position');g.exports=h},{'../utilities/plural':60,'../utilities/position':61,'../utilities/to-string':62,'../utilities/visit':63}],5:[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.isGenerated(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('../utilities/visit'),a=b('../utilities/position'),d=a.start,e=a.end,f={null:!0,fenced:!0,indented:!0};g.exports=h},{'../utilities/position':61,'../utilities/visit':63}],6:[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.isGenerated(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('../utilities/visit'),a=c('../utilities/position'),d=/^\s*\[((?:\\[\s\S]|[^\[\]])+)\]/;e.exports=f},{'../utilities/position':61,'../utilities/visit':63}],7:[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.isGenerated(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('../utilities/visit'),a=c('../utilities/position'),d=/^\s*\[((?:\\[\s\S]|[^\[\]])+)\]/;e.exports=f},{'../utilities/position':61,'../utilities/visit':63}],8:[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.isGenerated(c))return;b?d!==b&&e.warn('Emphasis should use `'+b+'` as a marker',c):b=d}),g()}var c=b('../utilities/visit'),a=b('../utilities/position'),d={'*':!0,_:!0,null:!0};e.exports=f},{'../utilities/position':61,'../utilities/visit':63}],9:[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.isGenerated(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('../utilities/visit'),a=b('../utilities/position'),d=a.start,e=a.end;f.exports=g},{'../utilities/position':61,'../utilities/visit':63}],10:[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.isGenerated(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('../utilities/visit'),a=c('../utilities/position'),b={'`':!0,'~':!0,null:!0};e.exports=f},{'../utilities/position':61,'../utilities/visit':63}],11:[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},{}],12:[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.isGenerated(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('../utilities/visit'),a=b('../utilities/position'),d=a.start;e.exports=f},{'../utilities/position':61,'../utilities/visit':63}],13:[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},{}],14:[function(a,d,f){'use strict';function e(a,d,f,e){b(a,'heading',function(a){return c.isGenerated(a)?null:(a.depth!==1&&d.warn('First heading level should be `1`',a),!1)}),e()}var b=a('../utilities/visit'),c=a('../utilities/position');d.exports=e},{'../utilities/position':61,'../utilities/visit':63}],15:[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.isGenerated(c))return;d.slice(e,f).length>3&&b.warn('Use two spaces for hard line breaks',c)}),f()}var c=b('../utilities/visit'),a=b('../utilities/position');d.exports=e},{'../utilities/position':61,'../utilities/visit':63}],16:[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.isGenerated(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('../utilities/visit'),c=a('../utilities/position');d.exports=e},{'../utilities/position':61,'../utilities/visit':63}],17:[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.isGenerated(c))return;a?b(c,a)!==a&&g.warn('Headings should use '+a,c):a=b(c,a)}),h()}var c=a('../utilities/visit'),b=a('../utilities/heading-style'),d=a('../utilities/position'),e=['atx','atx-closed','setext'];f.exports=g},{'../utilities/heading-style':59,'../utilities/position':61,'../utilities/visit':63}],18:[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'),'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,'./code-block-style':5,'./definition-case':6,'./definition-spacing':7,'./emphasis-marker':8,'./fenced-code-flag':9,'./fenced-code-marker':10,'./file-extension':11,'./final-definition':12,'./final-newline':13,'./first-heading-level':14,'./hard-break-spaces':15,'./heading-increment':16,'./heading-style':17,'./link-title-style':19,'./list-item-bullet-indent':20,'./list-item-content-indent':21,'./list-item-indent':22,'./list-item-spacing':23,'./maximum-heading-length':24,'./maximum-line-length':25,'./no-auto-link-without-protocol':26,'./no-blockquote-without-caret':27,'./no-consecutive-blank-lines':28,'./no-duplicate-definitions':29,'./no-duplicate-headings':30,'./no-emphasis-as-heading':31,'./no-file-name-articles':32,'./no-file-name-consecutive-dashes':33,'./no-file-name-irregular-characters':34,'./no-file-name-mixed-case':35,'./no-file-name-outer-dashes':36,'./no-heading-content-indent':37,'./no-heading-indent':38,'./no-heading-punctuation':39,'./no-html':40,'./no-inline-padding':41,'./no-literal-urls':42,'./no-missing-blank-lines':43,'./no-multiple-toplevel-headings':44,'./no-shell-dollars':45,'./no-shortcut-reference-image':46,'./no-shortcut-reference-link':47,'./no-table-indentation':48,'./no-tabs':49,'./ordered-list-marker-style':50,'./ordered-list-marker-value':51,'./rule-style':52,'./strong-marker':53,'./table-cell-padding':54,'./table-pipe-alignment':55,'./table-pipes':56,'./unordered-list-marker-style':57}],19:[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.isGenerated(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('../utilities/visit'),b=d('../utilities/position'),c={'"':!0,"'":!0,')':!0,null:!0},e=b.end;f.exports=g},{'../utilities/position':61,'../utilities/visit':63}],20:[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.isGenerated(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('../utilities/visit'),c=b('../utilities/position'),e=b('../utilities/plural'),a=c.start;f.exports=g},{'../utilities/plural':60,'../utilities/position':61,'../utilities/visit':63}],21:[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.isGenerated(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('../utilities/visit'),b=a('../utilities/position'),e=a('../utilities/plural'),c=b.start;f.exports=g},{'../utilities/plural':60,'../utilities/position':61,'../utilities/visit':63}],22:[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.isGenerated(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('../utilities/visit'),c=b('../utilities/position'),e=b('../utilities/plural'),a=c.start,f={'tab-size':!0,mixed:!0,space:!0};g.exports=h},{'../utilities/plural':60,'../utilities/position':61,'../utilities/visit':63}],23:[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.isGenerated(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('../utilities/visit'),a=d('../utilities/position'),b=a.start,c=a.end;f.exports=g},{'../utilities/position':61,'../utilities/visit':63}],24:[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.isGenerated(b))return;c(b).length>a&&f.warn('Use headings shorter than `'+a+'`',b)}),g()}var b=a('../utilities/visit'),c=a('../utilities/to-string'),d=a('../utilities/position');e.exports=f},{'../utilities/position':61,'../utilities/to-string':62,'../utilities/visit':63}],25:[function(e,f,i){'use strict';function g(a){return a.type==='heading'||a.type==='table'||a.type==='code'}function h(l,n,i,p){function k(a,b){a--;while(++a<b)h[a]=''}var e=i&&i!==!0?i:80,m=n.toString(),h=m.split('\n'),f=-1,o=h.length,j;c(l,function(c){var e=g(c),f=e&&b(c).line,h=e&&d(c).line;if(!e||a.isGenerated(c))return;k(f-1,h)}),c(l,'link',function(g,i,j){var c=j.children[i+1],f=b(g),h=d(g);if(a.isGenerated(g))return;if(f.column>e||h.column<e)return;if(c&&b(c).line===f.line&&(!c.value||/^(.+?[ \t].+?)/.test(c.value)))return;k(f.line-1,h.line)});while(++f<o)j=h[f].length,j>e&&n.warn('Line must be at most '+e+' characters',{line:f+1,column:j+1});p()}var c=e('../utilities/visit'),a=e('../utilities/position'),b=a.start,d=a.end;f.exports=h},{'../utilities/position':61,'../utilities/visit':63}],26:[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.isGenerated(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('../utilities/visit'),f=d('../utilities/to-string'),a=d('../utilities/position'),c=a.start,b=a.end,g=/^[a-z][a-z+.-]+:\/?/i;j.exports=h},{'../utilities/position':61,'../utilities/to-string':62,'../utilities/visit':63}],27:[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.isGenerated(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<e){if(a=d.charAt(f),a==='>')return;if(a!==' '&&a!==' ')break}b.warn('Missing caret in blockquote',{line:c,column:h})})}),g()}var c=b('../utilities/visit'),a=b('../utilities/position');d.exports=e},{'../utilities/position':61,'../utilities/visit':63}],28:[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.isGenerated(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)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('../utilities/visit'),a=b('../utilities/position'),d=b('../utilities/plural'),e=2;f.exports=g},{'../utilities/plural':60,'../utilities/position':61,'../utilities/visit':63}],29:[function(c,d,f){'use strict';function e(d,f,h,g){function e(b){var d=c[b.identifier],e;if(a.isGenerated(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('../utilities/position'),b=c('../utilities/visit');d.exports=e},{'../utilities/position':61,'../utilities/visit':63}],30:[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.isGenerated(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('../utilities/position'),c=a('../utilities/visit'),d=a('../utilities/to-string');e.exports=f},{'../utilities/position':61,'../utilities/to-string':62,'../utilities/visit':63}],31:[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.isGenerated(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('../utilities/visit'),c=a('../utilities/to-string'),d=a('../utilities/position');e.exports=f},{'../utilities/position':61,'../utilities/to-string':62,'../utilities/visit':63}],32:[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},{}],33:[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},{}],34:[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},{}],35:[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},{}],36:[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},{}],37:[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.isGenerated(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('../utilities/visit'),g=c('../utilities/heading-style'),e=c('../utilities/plural'),b=c('../utilities/position'),a=b.start,d=b.end;i.exports=h},{'../utilities/heading-style':59,'../utilities/plural':60,'../utilities/position':61,'../utilities/visit':63}],38:[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.isGenerated(l))return;while(++i<g)if(k=a.charAt(i),k!==' '&&k!==' ')break;c=i-j,c&&f.warn('Remove '+c+' '+d('space',c)+' before this heading',{line:h.line,column:h.column+c})}),i()}var c=a('../utilities/visit'),d=a('../utilities/plural'),b=a('../utilities/position'),e=b.start;f.exports=g},{'../utilities/plural':60,'../utilities/position':61,'../utilities/visit':63}],39:[function(a,e,g){'use strict';function f(e,f,a,g){a=typeof a==='string'?a:'\\.,;:!?',b(e,'heading',function(e){var b=d(e);if(c.isGenerated(e))return;b=b.charAt(b.length-1),new RegExp('['+a+']').test(b)&&f.warn('Don’t add a trailing `'+b+'` to headings',e)}),g()}var b=a('../utilities/visit'),c=a('../utilities/position'),d=a('../utilities/to-string');e.exports=f},{'../utilities/position':61,'../utilities/to-string':62,'../utilities/visit':63}],40:[function(a,d,f){'use strict';function e(a,d,f,e){b(a,'html',function(a){c.isGenerated(a)||/^\s*<!--/.test(a.value)||d.warn('Do not use HTML in markdown',a)}),e()}var b=a('../utilities/visit'),c=a('../utilities/position');d.exports=e},{'../utilities/position':61,'../utilities/visit':63}],41:[function(a,e,g){'use strict';function f(a,e,g,f){b(a,function(b){var a=b.type,f;if(c.isGenerated(b))return;(a==='emphasis'||a==='strong'||a==='delete'||a==='image'||a==='link')&&(f=d(b),(f.charAt(0)===' '||f.charAt(f.length-1)===' ')&&e.warn('Don’t pad `'+a+'` with inner spaces',b))}),f()}var b=a('../utilities/visit'),c=a('../utilities/position'),d=a('../utilities/to-string');e.exports=f},{'../utilities/position':61,'../utilities/to-string':62,'../utilities/visit':63}],42:[function(d,f,h){'use strict';function g(d,f,h,g){e(d,'link',function(d){var e=b(d.children[0]).column,g=c(d.children[d.children.length-1]).column,h=b(d).column,i=c(d).column;if(a.isGenerated(d))return;h===e&&i===g&&f.warn('Don’t use literal URLs without angle brackets',d)}),g()}var e=d('../utilities/visit'),a=d('../utilities/position'),b=a.start,c=a.end;f.exports=g},{'../utilities/position':61,'../utilities/visit':63}],43:[function(b,e,g){'use strict';function c(a){return['paragraph','blockquote','heading','code','yaml','html','list','table','horizontalRule'].indexOf(a.type)!==-1}function f(b,e,g,f){d(b,function(d,g,f){var b=f&&f.children[g+1];if(a.isGenerated(d))return;b&&c(d)&&c(b)&&a.start(b).line===a.end(d).line+1&&e.warn('Missing blank line before block node',b)}),f()}var d=b('../utilities/visit'),a=b('../utilities/position');e.exports=f},{'../utilities/position':61,'../utilities/visit':63}],44:[function(b,d,f){'use strict';function e(d,e,g,f){var b=!1;c(d,'heading',function(c){var d;if(a.isGenerated(c))return;c.depth===1&&(b&&(d=a.start(c),e.warn('Don’t use multiple top level headings ('+d.line+':'+d.column+')',c)),b=c)}),f()}var c=b('../utilities/visit'),a=b('../utilities/position');d.exports=e},{'../utilities/position':61,'../utilities/visit':63}],45:[function(a,e,g){'use strict';function f(a,e,g,f){b(a,'code',function(a){var b=a.lang,f=a.value,g;if(c.isGenerated(a))return;(!b||d.indexOf(b)!==-1)&&(g=f.length&&f.split('\n').every(function(a){return Boolean(!a.trim()||a.match(/^\s*\$\s*/))}),g&&e.warn('Do not use dollar signs before shell-commands',a))}),f()}var b=a('../utilities/visit'),c=a('../utilities/position'),d=['sh','bash','bats','cgi','command','fcgi','ksh','tmux','tool','zsh'];e.exports=f},{'../utilities/position':61,'../utilities/visit':63}],46:[function(a,d,f){'use strict';function e(a,d,f,e){b(a,'imageReference',function(a){if(c.isGenerated(a))return;a.referenceType==='shortcut'&&d.warn('Use the trailing [] on reference images',a)}),e()}var b=a('../utilities/visit'),c=a('../utilities/position');d.exports=e},{'../utilities/position':61,'../utilities/visit':63}],47:[function(a,d,f){'use strict';function e(a,d,f,e){b(a,'linkReference',function(a){if(c.isGenerated(a))return;a.referenceType==='shortcut'&&d.warn('Use the trailing [] on reference links',a)}),e()}var b=a('../utilities/visit'),c=a('../utilities/position');d.exports=e},{'../utilities/position':61,'../utilities/visit':63}],48:[function(b,d,f){'use strict';function e(d,b,f,e){c(d,'table',function(c){var d=b.toString();if(a.isGenerated(c))return;c.children.forEach(function(c){var e=d.slice(a.start(c).offset,a.start(c.children[0]).offset);e.indexOf('|')>1&&b.warn('Do not indent table rows',c)})}),e()}var c=b('../utilities/visit'),a=b('../utilities/position');d.exports=e},{'../utilities/position':61,'../utilities/visit':63}],49:[function(c,a,d){'use strict';function b(f,b,g,e){var c=b.toString(),a=-1,d=c.length;while(++a<d)c.charAt(a)===' '&&b.warn('Use spaces instead of hard-tabs',b.offsetToPosition(a));e()}a.exports=b},{}],50:[function(c,f,h){'use strict';function g(h,f,c,i){var g=f.toString();if(c=typeof c!=='string'||c==='consistent'?null:c,e[c]!==!0){f.fail('Invalid ordered list-item marker style `'+c+"`: use either `'.'` or `')'`");return}d(h,'list',function(d){var e=d.children;if(!d.ordered)return;e.forEach(function(e){var h=e.children[0],i=b(e).offset,j=b(h).offset,d;if(a.isGenerated(e))return;d=g.slice(i,j).replace(/\s|\d/g,''),d=d.replace(/\[[x ]?\]\s*$/i,''),c?d!==c&&f.warn('Marker style should be `'+c+'`',e):c=d})}),i()}var d=c('../utilities/visit'),a=c('../utilities/position'),b=a.start,e={')':!0,'.':!0,null:!0};f.exports=g},{'../utilities/position':61,'../utilities/visit':63}],51:[function(c,f,h){'use strict';function g(h,f,c,i){var g=f.toString();if(c=typeof c!=='string'?'ordered':c,e[c]!==!0){f.fail('Invalid ordered list-item marker value `'+c+"`: use either `'ordered'` or `'one'`");return}d(h,'list',function(e){var h=e.children,d=(c==='one'?1:e.start)||1;if(!e.ordered)return;h.forEach(function(h,l){var i=h.children[0],j=b(h).offset,k=b(i).offset,e;if(l===0)return;if(c==='ordered'&&d++,a.isGenerated(h))return;e=g.slice(j,k).replace(/[\s\.\)]/g,''),e=Number(e.replace(/\[[x ]?\]\s*$/i,'')),e!==d&&f.warn('Marker should be `'+d+'`, was `'+e+'`',h)})}),i()}var d=c('../utilities/visit'),a=c('../utilities/position'),b=a.start,e={ordered:!0,single:!0,one:!0};f.exports=g},{'../utilities/position':61,'../utilities/visit':63}],52:[function(b,f,i){'use strict';function g(a){return a===null||!/[^-_* ]/.test(a)}function h(i,f,b,j){var h=f.toString();if(b=typeof b!=='string'||b==='consistent'?null:b,g(b)!==!0){f.fail("Invalid preferred rule-style: provide a valid markdown rule, or `'consistent'`");return}c(i,'horizontalRule',function(c){var i=d(c).offset,j=e(c).offset,g;if(a.isGenerated(c))return;g=h.slice(i,j),b?g!==b&&f.warn('Horizontal rules should use `'+b+'`',c):b=g}),j()}var c=b('../utilities/visit'),a=b('../utilities/position'),d=a.start,e=a.end;f.exports=h},{'../utilities/position':61,'../utilities/visit':63}],53:[function(b,e,g){'use strict';function f(f,e,b,g){b=typeof b!=='string'||b==='consistent'?null:b,d[b]!==!0?e.fail('Invalid strong marker `'+b+"`: use either `'consistent'`, `'*'`, or `'_'`"):c(f,'strong',function(c){var d=e.toString().charAt(a.start(c).offset);if(a.isGenerated(c))return;b?d!==b&&e.warn('Strong should use `'+b+'` as a marker',c):b=d}),g()}var c=b('../utilities/visit'),a=b('../utilities/position'),d={'*':!0,_:!0,null:!0};e.exports=f},{'../utilities/position':61,'../utilities/visit':63}],54:[function(d,g,i){'use strict';function h(h,g,d,i){d=typeof d!=='string'||d==='consistent'?null:d,f[d]!==!0&&g.fail('Invalid table-cell-padding style `'+d+'`'),e(h,'table',function(l){function k(d,e,g,i,b){var c=o.slice(d,e),a=c.indexOf('|');g&&a!==-1&&(f[b]===undefined||a<f[b])&&(f[b]=a),i&&a!==-1&&(a=c.length-a-1,(h[b+1]===undefined||a<h[b+1])&&(h[b+1]=a))}var i=l.children,o=g.toString(),h=[],f=[],m,j,e,p,n;if(b.isGenerated(l))return;i.forEach(function(d){var b=d.children;k(a(d).offset,a(b[0]).offset,null,b[0],-1),b.forEach(function(f,g){var e=b[g+1]||null,h=a(e).offset||c(d).offset;k(c(f).offset,h,f,e,g)})}),j=h.concat(f),e=d==='padded'?1:d==='compact'?0:null,d==='padded'?e=1:d==='compact'?e=0:j.some(function(a){return e=Math.min(a,1),!0}),m=i[0].children.map(function(b){return a(b)}).concat(i[0].children.map(function(a){return c(a)})),p=e===1?'padded':'compact',n='Cell should be '+p+', isn’t',j.forEach(function(a,b){a!==e&&a!==undefined&&g.warn(n,m[b])})}),i()}var e=d('../utilities/visit'),b=d('../utilities/position'),a=b.start,c=b.end,f={null:!0,padded:!0,compact:!0};g.exports=h},{'../utilities/position':61,'../utilities/visit':63}],55:[function(d,f,h){'use strict';function g(f,d,h,g){e(f,'table',function(g){function h(c,g,b){var a=c+i.slice(c,g).indexOf('|')-j+1;e[b]===undefined?e[b]=a:a!==e[b]&&d.warn('Misaligned table fence',{start:{line:f,column:a},end:{line:f,column:a+1}})}var i=d.toString(),e=[],j,f;if(b.isGenerated(g))return;g.children.forEach(function(b){var d=b.children;f=a(b).line,j=a(b).offset,h(a(b).offset,a(d[0]).offset,0),b.children.forEach(function(g,e){var f=a(d[e+1]).offset||c(b).offset;h(c(g).offset,f,e+1)})})}),g()}var e=d('../utilities/visit'),b=d('../utilities/position'),a=b.start,c=b.end;f.exports=g},{'../utilities/position':61,'../utilities/visit':63}],56:[function(d,f,h){'use strict';function g(f,d,h,g){e(f,'table',function(f){var e=d.toString();f.children.forEach(function(f){var g=f.children,h=g[0],i=g[g.length-1],j=e.slice(b(f).offset,b(h).offset),k=e.slice(c(i).offset,c(f).offset);if(a.isGenerated(f))return;j.indexOf('|')===-1&&d.warn('Missing initial pipe in table fence',b(f)),k.indexOf('|')===-1&&d.warn('Missing final pipe in table fence',c(f))})}),g()}var e=d('../utilities/visit'),a=d('../utilities/position'),b=a.start,c=a.end;f.exports=g},{'../utilities/position':61,'../utilities/visit':63}],57:[function(c,f,h){'use strict';function g(h,f,c,i){var g=f.toString();if(c=typeof c!=='string'||c==='consistent'?null:c,e[c]!==!0){f.fail('Invalid unordered list-item marker style `'+c+"`: use either `'-'`, `'*'`, or `'+'`");return}d(h,'list',function(d){var e=d.children;if(d.ordered)return;e.forEach(function(e){var h=e.children[0],i=b(e).offset,j=b(h).offset,d;if(a.isGenerated(e))return;d=g.slice(i,j).replace(/\s/g,''),d=d.replace(/\[[x ]?\]\s*$/i,''),c?d!==c&&f.warn('Marker style should be `'+c+'`',e):c=d})}),i()}var d=c('../utilities/visit'),a=c('../utilities/position'),b=a.start,e={'-':!0,'*':!0,'+':!0,null:!0};f.exports=g},{'../utilities/position':61,'../utilities/visit':63}],58:[function(d,a,e){'use strict';function b(b,a){a.messages.sort(function(a,b){return a.line===undefined||b.line===undefined?-1:a.line===b.line?a.column-b.column:a.line-b.line})}function c(){return b}a.exports=c},{}],59:[function(c,d,f){'use strict';function b(b,a){return b<3?'atx':a==='atx'||a==='setext'?a:null}function e(c,f){var e=c.children[c.children.length-1],d=c.depth;return e?a(e).line+1===a(c).line?'setext':a(e).column+d<a(c).column?'atx-closed':b(d,f):a(c).column<d*2?b(d,f):'atx-closed'}var a=c('./position').end;d.exports=e},{'./position':61}],60:[function(c,a,d){'use strict';function b(a,b){return b===1?a:a+'s'}a.exports=b},{}],61:[function(g,e,h){'use strict';function c(a){return function(b){return b&&b.position&&b.position[a]||{}}}function f(e){var c=a(e),d=b(e);return c.line===undefined||c.column===undefined||d.line===undefined||d.column===undefined}var a=c('start'),b=c('end'),d={start:a,end:b,isGenerated:f};e.exports=d},{}],62:[function(d,b,e){'use strict';function c(a){return a&&(a.value?a.value:a.alt?a.alt:a.title)||''}function a(b){return c(b)||b.children&&b.children.map(a).join('')||''}b.exports=a},{}],63:[function(e,a,f){'use strict';function b(b,d){var a=-1,c=b.length;while(++a<c)if(d(b[a],a)===!1)return!1;return!0}function c(b,d){var a=b.length,c=-1;while(--a>c)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 e(a,c,b)})},e=function(b,e,f){var c;return(!a||b.type===a)&&(c=d(b,e||0,f||null)),b.children&&c!==!1?h(b.children,b):c},e(i)}a.exports=d},{}],64:[function(i,c,j){'use strict';function e(b,c){function a(e){c(e);var b=e.children,d=-1,f=b?b.length:0;while(++d<f)a(b[d])}a(b)}function b(c){var d=0,a=-1,e=c.length,b=[];while(++a<e)b[a]=d+=c[a].length+1;return b}function a(a,b){a.offset=b(a)}function h(a){function b(b){var c=b&&b.line,d=b&&b.column;return isNaN(c)||isNaN(d)?-1:(a[c-2]||0)+d-1||0}return b}function f(a){function b(c){var b=-1,d=a.length;if(c<0)return{};while(++b<d)if(a[b]>c)return{line:b+1,column:(c-a[b-1]||0)+1};return{}}return b}function d(i,c){var d=String(c).split('\n'),g;if(!c||typeof c.contents!=='string')throw new Error('Missing `file` for mdast-range');d=b(d),g=h(d),c.offsetToPosition=f(d),c.positionToOffset=g,e(i,function(c){var b=c.position;b&&b.start&&a(b.start,g),b&&b.end&&a(b.end,g)})}function g(){return d}c.exports=g},{}],65:[function(n,h,m){'use strict';function f(a){return new RegExp('(\\s*<!--\\s*('+a+')'+'\\s*'+'('+'start'+'|'+'end'+')?'+'\\s*'+'('+'[\\s\\S]*?'+')'+'\\s*'+'-->'+'\\s*'+')')}function j(b,c){function a(b,e){var d=this||null;c(b,d,e),b.children&&b.children.forEach(a,b)}a(b)}function g(c){var a={};return c.replace(b,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 f=e.value,c,h;return e.type!=='html'?null:(c=f.match(d),!c||c[1].length!==f.length||c[2]!==a.name?null:(h={type:c[3]||'marker',attributes:c[4]||'',parameters:g(c[4]||''),node:e},b&&b(h,i),h))}var c=a.name,d=f(c);return e}function d(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 e(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 k(h){function l(l,m,j){var a=k(l),h=a&&a.type;d&&m===d&&(h==='start'&&e++,h==='end'&&e--,h==='end'&&e===0?(b=i(f,b,a,{start:j-b.length-1,end:j,parent:d}),b&&c.apply(d.children,[g,j+1].concat(b)),f=null,d=null,g=null,b=[]):b.push(l)),!d&&h==='start'&&(e=1,g=j,f=a,d=m)}var i=h.onrun,k=a(h),b=[],f=null,d=null,e=0,g;return function(a){j(a,l)}}function l(b,a){var c=b.Parser.prototype.blockTokenizers,f=b.Parser.prototype.inlineTokenizers,g=b.Compiler.prototype;return a.onparse&&(c.html=d(c.html,a),f.tag=d(f.tag,a)),a.onstringify&&(g.html=e(g.html,a)),a.onrun?k(a):null}function i(a){if(!(a&&a.name))throw new Error('Missing `name` in `options`');return function(b){return l(b,a)}}var c=[].splice,b=new RegExp('\\s*([-a-z09_]+)(?:=(?:"((?:\\\\[\\s\\S]|[^"])+)"|\'((?:\\\\[\\s\\S]|[^\'])+)\'|((?:\\\\[\\s\\S]|[^"\'\\s])+)))?\\s*','gi');h.exports=i},{}]},{},[1])(1)})
|