- md5
- 8fb09a10aa3256b7f7e00e02d409445c
- sha1
- 512942a774a83cd6a181b570947f4840387806c5
- sha256
- 6ec526b785ec82f527af929633cfe38c5293e3a622293f58861ffbd7bad711f0
!function(a){"object"==typeof exports&&"object"==typeof module?a(require("../../lib/codemirror"),require("../xml/xml"),require("../meta")):"function"==typeof define&&define.amd?define(["../../lib/codemirror","../xml/xml","../meta"],a):a(CodeMirror)}(function(a){"use strict";a.defineMode("markdown",function(b,c){function d(c){if(a.findModeByName){var d=a.findModeByName(c);d&&(c=d.mime||d.mimes[0])}var e=a.getMode(b,c);return"null"==e.name?null:e}function e(a,b,c){return b.f=b.inline=c,c(a,b)}function f(a,b,c){return b.f=b.block=c,c(a,b)}function g(a){return!a||!/\S/.test(a.string)}function h(a){return a.linkTitle=!1,a.em=!1,a.strong=!1,a.strikethrough=!1,a.quote=0,a.indentedCode=!1,w||a.f!=j||(a.f=o,a.block=i),a.trailingSpace=0,a.trailingSpaceNewLine=!1,a.prevLine=a.thisLine,a.thisLine=null,null}function i(a,b){var f=a.sol(),h=b.list!==!1,i=b.indentedCode;b.indentedCode=!1,h&&(b.indentationDiff>=0?(b.indentationDiff<4&&(b.indentation-=b.indentationDiff),b.list=null):b.indentation>0?(b.list=null,b.listDepth=Math.floor(b.indentation/4)):(b.list=!1,b.listDepth=0));var j=null;if(b.indentationDiff>=4)return a.skipToEnd(),i||g(b.prevLine)?(b.indentation-=4,b.indentedCode=!0,A):null;if(a.eatSpace())return null;if((j=a.match(T))&&j[1].length<=6)return b.header=j[1].length,c.highlightFormatting&&(b.formatting="header"),b.f=b.inline,m(b);if(!(g(b.prevLine)||b.quote||h||i)&&(j=a.match(U)))return b.header="="==j[0].charAt(0)?1:2,c.highlightFormatting&&(b.formatting="header"),b.f=b.inline,m(b);if(a.eat(">"))return b.quote=f?1:b.quote+1,c.highlightFormatting&&(b.formatting="quote"),a.eatSpace(),m(b);if("["===a.peek())return e(a,b,s);if(a.match(P,!0))return b.hr=!0,F;if((g(b.prevLine)||h)&&(a.match(Q,!1)||a.match(R,!1))){var l=null;return a.match(Q,!0)?l="ul":(a.match(R,!0),l="ol"),b.indentation=a.column()+a.current().length,b.list=!0,b.listDepth++,c.taskLists&&a.match(S,!1)&&(b.taskList=!0),b.f=b.inline,c.highlightFormatting&&(b.formatting=["list","list-"+l]),m(b)}return c.fencedCodeBlocks&&(j=a.match(W,!0))?(b.fencedChars=j[1],b.localMode=d(j[2]),b.localMode&&(b.localState=b.localMode.startState()),b.f=b.block=k,c.highlightFormatting&&(b.formatting="code-block"),b.code=!0,m(b)):e(a,b,b.inline)}function j(a,b){var c=x.token(a,b.htmlState);return(w&&null===b.htmlState.tagStart&&!b.htmlState.context&&b.htmlState.tokenize.isInText||b.md_inside&&a.current().indexOf(">")>-1)&&(b.f=o,b.block=i,b.htmlState=null),c}function k(a,b){return a.sol()&&b.fencedChars&&a.match(b.fencedChars,!1)?(b.localMode=b.localState=null,b.f=b.block=l,null):b.localMode?b.localMode.token(a,b.localState):(a.skipToEnd(),A)}function l(a,b){a.match(b.fencedChars),b.block=i,b.f=o,b.fencedChars=null,c.highlightFormatting&&(b.formatting="code-block"),b.code=!0;var d=m(b);return b.code=!1,d}function m(a){var b=[];if(a.formatting){b.push(H),"string"==typeof a.formatting&&(a.formatting=[a.formatting]);for(var d=0;d<a.formatting.length;d++)b.push(H+"-"+a.formatting[d]),"header"===a.formatting[d]&&b.push(H+"-"+a.formatting[d]+"-"+a.header),"quote"===a.formatting[d]&&(!c.maxBlockquoteDepth||c.maxBlockquoteDepth>=a.quote?b.push(H+"-"+a.formatting[d]+"-"+a.quote):b.push("error"))}if(a.taskOpen)return b.push("meta"),b.length?b.join(" "):null;if(a.taskClosed)return b.push("property"),b.length?b.join(" "):null;if(a.linkHref?b.push(L,"url"):(a.strong&&b.push(N),a.em&&b.push(M),a.strikethrough&&b.push(O),a.linkText&&b.push(K),a.code&&b.push(A)),a.header&&(b.push(z),b.push(z+"-"+a.header)),a.quote&&(b.push(B),!c.maxBlockquoteDepth||c.maxBlockquoteDepth>=a.quote?b.push(B+"-"+a.quote):b.push(B+"-"+c.maxBlockquoteDepth)),a.list!==!1){var e=(a.listDepth-1)%3;e?1===e?b.push(D):b.push(E):b.push(C)}return a.trailingSpaceNewLine?b.push("trailing-space-new-line"):a.trailingSpace&&b.push("trailing-space-"+(a.trailingSpace%2?"a":"b")),b.length?b.join(" "):null}function n(a,b){return a.match(V,!0)?m(b):void 0}function o(b,d){var e=d.text(b,d);if("undefined"!=typeof e)return e;if(d.list)return d.list=null,m(d);if(d.taskList){var g="x"!==b.match(S,!0)[1];return g?d.taskOpen=!0:d.taskClosed=!0,c.highlightFormatting&&(d.formatting="task"),d.taskList=!1,m(d)}if(d.taskOpen=!1,d.taskClosed=!1,d.header&&b.match(/^#+$/,!0))return c.highlightFormatting&&(d.formatting="header"),m(d);var h=b.sol(),i=b.next();if("\\"===i&&(b.next(),c.highlightFormatting)){var k=m(d);return k?k+" formatting-escape":"formatting-escape"}if(d.linkTitle){d.linkTitle=!1;var l=i;"("===i&&(l=")"),l=(l+"").replace(/([.?*+^$[\]\\(){}|-])/g,"\\$1");var n="^\\s*(?:[^"+l+"\\\\]+|\\\\\\\\|\\\\.)"+l;if(b.match(new RegExp(n),!0))return L}if("`"===i){var o=d.formatting;c.highlightFormatting&&(d.formatting="code");var r=m(d),s=b.pos;b.eatWhile("`");var t=1+b.pos-s;return d.code?t===y?(d.code=!1,r):(d.formatting=o,m(d)):(y=t,d.code=!0,m(d))}if(d.code)return m(d);if("!"===i&&b.match(/\[[^\]]*\] ?(?:\(|\[)/,!1))return b.match(/\[[^\]]*\]/),d.inline=d.f=q,G;if("["===i&&b.match(/.*\](\(.*\)| ?\[.*\])/,!1))return d.linkText=!0,c.highlightFormatting&&(d.formatting="link"),m(d);if("]"===i&&d.linkText&&b.match(/\(.*\)| ?\[.*\]/,!1)){c.highlightFormatting&&(d.formatting="link");var k=m(d);return d.linkText=!1,d.inline=d.f=q,k}if("<"===i&&b.match(/^(https?|ftps?):\/\/(?:[^\\>]|\\.)+>/,!1)){d.f=d.inline=p,c.highlightFormatting&&(d.formatting="link");var k=m(d);return k?k+=" ":k="",k+I}if("<"===i&&b.match(/^[^> \\]+@(?:[^\\>]|\\.)+>/,!1)){d.f=d.inline=p,c.highlightFormatting&&(d.formatting="link");var k=m(d);return k?k+=" ":k="",k+J}if("<"===i&&b.match(/^(!--|\w)/,!1)){var u=b.string.indexOf(">",b.pos);if(-1!=u){var v=b.string.substring(b.start,u);/markdown\s*=\s*('|"){0,1}1('|"){0,1}/.test(v)&&(d.md_inside=!0)}return b.backUp(1),d.htmlState=a.startState(x),f(b,d,j)}if("<"===i&&b.match(/^\/\w*?>/))return d.md_inside=!1,"tag";var w=!1;if(!c.underscoresBreakWords&&"_"===i&&"_"!==b.peek()&&b.match(/(\w)/,!1)){var z=b.pos-2;if(z>=0){var A=b.string.charAt(z);"_"!==A&&A.match(/(\w)/,!1)&&(w=!0)}}if("*"===i||"_"===i&&!w)if(h&&" "===b.peek());else{if(d.strong===i&&b.eat(i)){c.highlightFormatting&&(d.formatting="strong");var r=m(d);return d.strong=!1,r}if(!d.strong&&b.eat(i))return d.strong=i,c.highlightFormatting&&(d.formatting="strong"),m(d);if(d.em===i){c.highlightFormatting&&(d.formatting="em");var r=m(d);return d.em=!1,r}if(!d.em)return d.em=i,c.highlightFormatting&&(d.formatting="em"),m(d)}else if(" "===i&&(b.eat("*")||b.eat("_"))){if(" "===b.peek())return m(d);b.backUp(1)}if(c.strikethrough)if("~"===i&&b.eatWhile(i)){if(d.strikethrough){c.highlightFormatting&&(d.formatting="strikethrough");var r=m(d);return d.strikethrough=!1,r}if(b.match(/^[^\s]/,!1))return d.strikethrough=!0,c.highlightFormatting&&(d.formatting="strikethrough"),m(d)}else if(" "===i&&b.match(/^~~/,!0)){if(" "===b.peek())return m(d);b.backUp(2)}return" "===i&&(b.match(/ +$/,!1)?d.trailingSpace++:d.trailingSpace&&(d.trailingSpaceNewLine=!0)),m(d)}function p(a,b){var d=a.next();if(">"===d){b.f=b.inline=o,c.highlightFormatting&&(b.formatting="link");var e=m(b);return e?e+=" ":e="",e+I}return a.match(/^[^>]+/,!0),I}function q(a,b){if(a.eatSpace())return null;var d=a.next();return"("===d||"["===d?(b.f=b.inline=r("("===d?")":"]"),c.highlightFormatting&&(b.formatting="link-string"),b.linkHref=!0,m(b)):"error"}function r(a){return function(b,d){var e=b.next();if(e===a){d.f=d.inline=o,c.highlightFormatting&&(d.formatting="link-string");var f=m(d);return d.linkHref=!1,f}return b.match(v(a),!0)&&b.backUp(1),d.linkHref=!0,m(d)}}function s(a,b){return a.match(/^[^\]]*\]:/,!1)?(b.f=t,a.next(),c.highlightFormatting&&(b.formatting="link"),b.linkText=!0,m(b)):e(a,b,o)}function t(a,b){if(a.match(/^\]:/,!0)){b.f=b.inline=u,c.highlightFormatting&&(b.formatting="link");var d=m(b);return b.linkText=!1,d}return a.match(/^[^\]]+/,!0),K}function u(a,b){return a.eatSpace()?null:(a.match(/^[^\s]+/,!0),void 0===a.peek()?b.linkTitle=!0:a.match(/^(?:\s+(?:"(?:[^"\\]|\\\\|\\.)+"|'(?:[^'\\]|\\\\|\\.)+'|\((?:[^)\\]|\\\\|\\.)+\)))?/,!0),b.f=b.inline=o,L+" url")}function v(a){return X[a]||(a=(a+"").replace(/([.?*+^$[\]\\(){}|-])/g,"\\$1"),X[a]=new RegExp("^(?:[^\\\\]|\\\\.)*?("+a+")")),X[a]}var w=a.modes.hasOwnProperty("xml"),x=a.getMode(b,w?{name:"xml",htmlMode:!0}:"text/plain");void 0===c.highlightFormatting&&(c.highlightFormatting=!1),void 0===c.maxBlockquoteDepth&&(c.maxBlockquoteDepth=0),void 0===c.underscoresBreakWords&&(c.underscoresBreakWords=!0),void 0===c.taskLists&&(c.taskLists=!1),void 0===c.strikethrough&&(c.strikethrough=!1);var y=0,z="header",A="comment",B="quote",C="variable-2",D="variable-3",E="keyword",F="hr",G="tag",H="formatting",I="link",J="link",K="link",L="string",M="em",N="strong",O="strikethrough",P=/^([*\-_])(?:\s*\1){2,}\s*$/,Q=/^[*\-+]\s+/,R=/^[0-9]+([.)])\s+/,S=/^\[(x| )\](?=\s)/,T=c.allowAtxHeaderWithoutSpace?/^(#+)/:/^(#+)(?: |$)/,U=/^ *(?:\={1,}|-{1,})\s*$/,V=/^[^#!\[\]*_\\<>` "'(~]+/,W=new RegExp("^("+(c.fencedCodeBlocks===!0?"~~~+|```+":c.fencedCodeBlocks)+")[ \\t]*([\\w+#]*)"),X=[],Y={startState:function(){return{f:i,prevLine:null,thisLine:null,block:i,htmlState:null,indentation:0,inline:o,text:n,formatting:!1,linkText:!1,linkHref:!1,linkTitle:!1,em:!1,strong:!1,header:0,hr:!1,taskList:!1,list:!1,listDepth:0,quote:0,trailingSpace:0,trailingSpaceNewLine:!1,strikethrough:!1,fencedChars:null}},copyState:function(b){return{f:b.f,prevLine:b.prevLine,thisLine:b["this"],block:b.block,htmlState:b.htmlState&&a.copyState(x,b.htmlState),indentation:b.indentation,localMode:b.localMode,localState:b.localMode?a.copyState(b.localMode,b.localState):null,inline:b.inline,text:b.text,formatting:!1,linkTitle:b.linkTitle,code:b.code,em:b.em,strong:b.strong,strikethrough:b.strikethrough,header:b.header,hr:b.hr,taskList:b.taskList,list:b.list,listDepth:b.listDepth,quote:b.quote,indentedCode:b.indentedCode,trailingSpace:b.trailingSpace,trailingSpaceNewLine:b.trailingSpaceNewLine,md_inside:b.md_inside,fencedChars:b.fencedChars}},token:function(a,b){if(b.formatting=!1,a!=b.thisLine){var c=b.header||b.hr;if(b.header=0,b.hr=!1,a.match(/^\s*$/,!0)||c){if(h(b),!c)return null;b.prevLine=null}b.prevLine=b.thisLine,b.thisLine=a,b.taskList=!1,b.trailingSpace=0,b.trailingSpaceNewLine=!1,b.f=b.block;var d=a.match(/^\s*/,!0)[0].replace(/\t/g," ").length,e=4*Math.floor((d-b.indentation)/4);e>4&&(e=4);var f=b.indentation+e;if(b.indentationDiff=f-b.indentation,b.indentation=f,d>0)return null}return b.f(a,b)},innerMode:function(a){return a.block==j?{state:a.htmlState,mode:x}:a.localState?{state:a.localState,mode:a.localMode}:{state:a,mode:Y}},blankLine:h,getType:m,fold:"markdown"};return Y},"xml"),a.defineMIME("text/x-markdown","markdown")});
No other release has this exact content. See every version of this file.