%PDF- %PDF-
| Direktori : /data/old/home/stash/atlassian-stash/static/bower/CodeMirror/mode/markdown/ |
| Current File : //data/old/home/stash/atlassian-stash/static/bower/CodeMirror/mode/markdown/markdown-min.js |
CodeMirror.defineMode("markdown",function(W,X){var N=CodeMirror.modes.hasOwnProperty("xml");var I=CodeMirror.getMode(W,N?{name:"xml",htmlMode:true}:"text/plain");var a={html:"htmlmixed",js:"javascript",json:"application/json",c:"text/x-csrc","c++":"text/x-c++src",java:"text/x-java",csharp:"text/x-csharp","c#":"text/x-csharp",scala:"text/x-scala"};var e=(function(){var y,AC={},w={},AB;var AA=[];for(var v in CodeMirror.modes){if(CodeMirror.modes.propertyIsEnumerable(v)){AA.push(v)}}for(y=0;y<AA.length;y++){AC[AA[y]]=AA[y]}var z=[];for(var v in CodeMirror.mimeModes){if(CodeMirror.mimeModes.propertyIsEnumerable(v)){z.push({mime:v,mode:CodeMirror.mimeModes[v]})}}for(y=0;y<z.length;y++){AB=z[y].mime;w[AB]=z[y].mime}for(var x in a){if(a[x] in AC||a[x] in w){AC[x]=a[x]}}return function(AD){return AC[AD]?CodeMirror.getMode(W,AC[AD]):null}}());if(X.highlightFormatting===undefined){X.highlightFormatting=false}if(X.maxBlockquoteDepth===undefined){X.maxBlockquoteDepth=0}if(X.underscoresBreakWords===undefined){X.underscoresBreakWords=true}if(X.fencedCodeBlocks===undefined){X.fencedCodeBlocks=false}if(X.taskLists===undefined){X.taskLists=false}var J=0;var H="header",F="comment",P="quote",o="variable-2",m="variable-3",l="keyword",n="hr",G="tag",S="formatting",O="link",L="link",f="link",d="string",p="em",Y="strong";var A=/^([*\-=_])(?:\s*\1){2,}\s*$/,D=/^[*\-+]\s+/,b=/^[0-9]+\.\s+/,R=/^\[(x| )\](?=\s)/,r=/^#+/,u=/^(?:\={1,}|-{1,})$/,Z=/^[^#!\[\]*_\\<>` "'(]+/;function s(x,w,v){w.f=w.inline=v;return v(x,w)}function c(x,w,v){w.f=w.block=v;return v(x,w)}function B(v){v.linkTitle=false;v.em=false;v.strong=false;v.quote=0;if(!N&&v.f==Q){v.f=q;v.block=i}v.trailingSpace=0;v.trailingSpaceNewLine=false;v.thisLineHasContent=false;return null}function i(AA,z){var y=AA.sol();var w=(z.list!==false);if(z.list!==false&&z.indentationDiff>=0){if(z.indentationDiff<4){z.indentation-=z.indentationDiff}z.list=null}else{if(z.list!==false&&z.indentation>0){z.list=null;z.listDepth=Math.floor(z.indentation/4)}else{if(z.list!==false){z.list=false;z.listDepth=0}}}var v=null;if(z.indentationDiff>=4){z.indentation-=4;AA.skipToEnd();return F}else{if(AA.eatSpace()){return null}else{if(v=AA.match(r)){z.header=v[0].length<=6?v[0].length:6;if(X.highlightFormatting){z.formatting="header"}z.f=z.inline;return U(z)}else{if(z.prevLineHasContent&&(v=AA.match(u))){z.header=v[0].charAt(0)=="="?1:2;if(X.highlightFormatting){z.formatting="header"}z.f=z.inline;return U(z)}else{if(AA.eat(">")){z.indentation++;z.quote=y?1:z.quote+1;if(X.highlightFormatting){z.formatting="quote"}AA.eatSpace();return U(z)}else{if(AA.peek()==="["){return s(AA,z,C)}else{if(AA.match(A,true)){return n}else{if((!z.prevLineHasContent||w)&&(AA.match(D,false)||AA.match(b,false))){var x=null;if(AA.match(D,true)){x="ul"}else{AA.match(b,true);x="ol"}z.indentation+=4;z.list=true;z.listDepth++;if(X.taskLists&&AA.match(R,false)){z.taskList=true}z.f=z.inline;if(X.highlightFormatting){z.formatting=["list","list-"+x]}return U(z)}else{if(X.fencedCodeBlocks&&AA.match(/^```([\w+#]*)/,true)){z.localMode=e(RegExp.$1);if(z.localMode){z.localState=z.localMode.startState()}c(AA,z,h);if(X.highlightFormatting){z.formatting="code-block"}z.code=true;return U(z)}}}}}}}}}return s(AA,z,z.inline)}function Q(x,w){var v=I.token(x,w.htmlState);if((N&&!w.htmlState.tagName&&!w.htmlState.context)||(w.md_inside&&x.current().indexOf(">")>-1)){w.f=q;w.block=i;w.htmlState=null}return v}function h(x,w){if(x.sol()&&x.match(/^```/,true)){w.localMode=w.localState=null;w.f=q;w.block=i;if(X.highlightFormatting){w.formatting="code-block"}w.code=true;var v=U(w);w.code=false;return v}else{if(w.localMode){return w.localMode.token(x,w.localState)}else{x.skipToEnd();return F}}}function U(y){var x=[];if(y.formatting){x.push(S);if(typeof y.formatting==="string"){y.formatting=[y.formatting]}for(var v=0;v<y.formatting.length;v++){x.push(S+"-"+y.formatting[v]);if(y.formatting[v]==="header"){x.push(S+"-"+y.formatting[v]+"-"+y.header)}if(y.formatting[v]==="quote"){if(!X.maxBlockquoteDepth||X.maxBlockquoteDepth>=y.quote){x.push(S+"-"+y.formatting[v]+"-"+y.quote)}else{x.push("error")}}}}if(y.taskOpen){x.push("meta");return x.length?x.join(" "):null}if(y.taskClosed){x.push("property");return x.length?x.join(" "):null}if(y.linkHref){x.push(d);return x.length?x.join(" "):null}if(y.strong){x.push(Y)}if(y.em){x.push(p)}if(y.linkText){x.push(f)}if(y.code){x.push(F)}if(y.header){x.push(H);x.push(H+"-"+y.header)}if(y.quote){x.push(P);if(!X.maxBlockquoteDepth||X.maxBlockquoteDepth>=y.quote){x.push(P+"-"+y.quote)}else{x.push(P+"-"+X.maxBlockquoteDepth)}}if(y.list!==false){var w=(y.listDepth-1)%3;if(!w){x.push(o)}else{if(w===1){x.push(m)}else{x.push(l)}}}if(y.trailingSpaceNewLine){x.push("trailing-space-new-line")}else{if(y.trailingSpace){x.push("trailing-space-"+(y.trailingSpace%2?"a":"b"))}}return x.length?x.join(" "):null}function M(w,v){if(w.match(Z,true)){return U(v)}return undefined}function q(AK,w){var x=w.text(AK,w);if(typeof x!=="undefined"){return x}if(w.list){w.list=null;return U(w)}if(w.taskList){var AA=AK.match(R,true)[1]!=="x";if(AA){w.taskOpen=true}else{w.taskClosed=true}if(X.highlightFormatting){w.formatting="task"}w.taskList=false;return U(w)}w.taskOpen=false;w.taskClosed=false;if(w.header&&AK.match(/^#+$/,true)){if(X.highlightFormatting){w.formatting="header"}return U(w)}var AD=AK.sol();var v=AK.next();if(w.escape){w.escape=false;return U(w)}if(v==="\\"){if(X.highlightFormatting){w.formatting="escape"}w.escape=true;return U(w)}if(w.linkTitle){w.linkTitle=false;var AG=v;if(v==="("){AG=")"}AG=(AG+"").replace(/([.?*+^$[\]\\(){}|-])/g,"\\$1");var AF="^\\s*(?:[^"+AG+"\\\\]+|\\\\\\\\|\\\\.)"+AG;if(AK.match(new RegExp(AF),true)){return d}}if(v==="`"){var AI=w.formatting;if(X.highlightFormatting){w.formatting="code"}var AL=U(w);var AE=AK.pos;AK.eatWhile("`");var y=1+AK.pos-AE;if(!w.code){J=y;w.code=true;return U(w)}else{if(y===J){w.code=false;return AL}w.formatting=AI;return U(w)}}else{if(w.code){return U(w)}}if(v==="!"&&AK.match(/\[[^\]]*\] ?(?:\(|\[)/,false)){AK.match(/\[[^\]]*\]/);w.inline=w.f=V;return G}if(v==="["&&AK.match(/.*\](\(| ?\[)/,false)){w.linkText=true;if(X.highlightFormatting){w.formatting="link"}return U(w)}if(v==="]"&&w.linkText){if(X.highlightFormatting){w.formatting="link"}var AC=U(w);w.linkText=false;w.inline=w.f=V;return AC}if(v==="<"&&AK.match(/^(https?|ftps?):\/\/(?:[^\\>]|\\.)+>/,false)){w.f=w.inline=k;if(X.highlightFormatting){w.formatting="link"}var AC=U(w);if(AC){AC+=" "}else{AC=""}return AC+O}if(v==="<"&&AK.match(/^[^> \\]+@(?:[^\\>]|\\.)+>/,false)){w.f=w.inline=k;if(X.highlightFormatting){w.formatting="link"}var AC=U(w);if(AC){AC+=" "}else{AC=""}return AC+L}if(v==="<"&&AK.match(/^\w/,false)){if(AK.string.indexOf(">")!=-1){var AB=AK.string.substring(1,AK.string.indexOf(">"));if(/markdown\s*=\s*('|"){0,1}1('|"){0,1}/.test(AB)){w.md_inside=true}}AK.backUp(1);w.htmlState=CodeMirror.startState(I);return c(AK,w,Q)}if(v==="<"&&AK.match(/^\/\w*?>/)){w.md_inside=false;return"tag"}var z=false;if(!X.underscoresBreakWords){if(v==="_"&&AK.peek()!=="_"&&AK.match(/(\w)/,false)){var AH=AK.pos-2;if(AH>=0){var AJ=AK.string.charAt(AH);if(AJ!=="_"&&AJ.match(/(\w)/,false)){z=true}}}}if(v==="*"||(v==="_"&&!z)){if(AD&&AK.peek()===" "){}else{if(w.strong===v&&AK.eat(v)){if(X.highlightFormatting){w.formatting="strong"}var AL=U(w);w.strong=false;return AL}else{if(!w.strong&&AK.eat(v)){w.strong=v;if(X.highlightFormatting){w.formatting="strong"}return U(w)}else{if(w.em===v){if(X.highlightFormatting){w.formatting="em"}var AL=U(w);w.em=false;return AL}else{if(!w.em){w.em=v;if(X.highlightFormatting){w.formatting="em"}return U(w)}}}}}}else{if(v===" "){if(AK.eat("*")||AK.eat("_")){if(AK.peek()===" "){return U(w)}else{AK.backUp(1)}}}}if(v===" "){if(AK.match(/ +$/,false)){w.trailingSpace++}else{if(w.trailingSpace){w.trailingSpaceNewLine=true}}}return U(w)}function k(y,x){var w=y.next();if(w===">"){x.f=x.inline=q;if(X.highlightFormatting){x.formatting="link"}var v=U(x);if(v){v+=" "}else{v=""}return v+O}y.match(/^[^>]+/,true);return O}function V(x,w){if(x.eatSpace()){return null}var v=x.next();if(v==="("||v==="["){w.f=w.inline=j(v==="("?")":"]");if(X.highlightFormatting){w.formatting="link-string"}w.linkHref=true;return U(w)}return"error"}function j(v){return function(z,y){var x=z.next();if(x===v){y.f=y.inline=q;if(X.highlightFormatting){y.formatting="link-string"}var w=U(y);y.linkHref=false;return w}if(z.match(T(v),true)){z.backUp(1)}y.linkHref=true;return U(y)}}function C(w,v){if(w.match(/^[^\]]*\]:/,false)){v.f=g;w.next();if(X.highlightFormatting){v.formatting="link"}v.linkText=true;return U(v)}return s(w,v,q)}function g(x,w){if(x.match(/^\]:/,true)){w.f=w.inline=E;if(X.highlightFormatting){w.formatting="link"}var v=U(w);w.linkText=false;return v}x.match(/^[^\]]+/,true);return f}function E(w,v){if(w.eatSpace()){return null}w.match(/^[^\s]+/,true);if(w.peek()===undefined){v.linkTitle=true}else{w.match(/^(?:\s+(?:"(?:[^"\\]|\\\\|\\.)+"|'(?:[^'\\]|\\\\|\\.)+'|\((?:[^)\\]|\\\\|\\.)+\)))?/,true)}v.f=v.inline=q;return d}var t=[];function T(v){if(!t[v]){v=(v+"").replace(/([.?*+^$[\]\\(){}|-])/g,"\\$1");t[v]=new RegExp("^(?:[^\\\\]|\\\\.)*?("+v+")")}return t[v]}var K={startState:function(){return{f:i,prevLineHasContent:false,thisLineHasContent:false,block:i,htmlState:null,indentation:0,inline:q,text:M,escape:false,formatting:false,linkText:false,linkHref:false,linkTitle:false,em:false,strong:false,header:0,taskList:false,list:false,listDepth:0,quote:0,trailingSpace:0,trailingSpaceNewLine:false}},copyState:function(v){return{f:v.f,prevLineHasContent:v.prevLineHasContent,thisLineHasContent:v.thisLineHasContent,block:v.block,htmlState:v.htmlState&&CodeMirror.copyState(I,v.htmlState),indentation:v.indentation,localMode:v.localMode,localState:v.localMode?CodeMirror.copyState(v.localMode,v.localState):null,inline:v.inline,text:v.text,escape:false,formatting:false,linkTitle:v.linkTitle,em:v.em,strong:v.strong,header:v.header,taskList:v.taskList,list:v.list,listDepth:v.listDepth,quote:v.quote,trailingSpace:v.trailingSpace,trailingSpaceNewLine:v.trailingSpaceNewLine,md_inside:v.md_inside}},token:function(z,y){y.formatting=false;if(z.sol()){var v=z.match(/^\s*$/,true)||y.header;y.header=0;if(v){y.prevLineHasContent=false;return B(y)}else{y.prevLineHasContent=y.thisLineHasContent;y.thisLineHasContent=true}y.escape=false;y.taskList=false;y.code=false;y.trailingSpace=0;y.trailingSpaceNewLine=false;y.f=y.block;var w=z.match(/^\s*/,true)[0].replace(/\t/g," ").length;var AA=Math.floor((w-y.indentation)/4)*4;if(AA>4){AA=4}var x=y.indentation+AA;y.indentationDiff=x-y.indentation;y.indentation=x;if(w>0){return null}}return y.f(z,y)},innerMode:function(v){if(v.block==Q){return{state:v.htmlState,mode:I}}if(v.localState){return{state:v.localState,mode:v.localMode}}return{state:v,mode:K}},blankLine:B,getType:U,fold:"markdown"};return K},"xml");CodeMirror.defineMIME("text/x-markdown","markdown");