%PDF- %PDF-
Direktori : /home1/lightco1/www/aldobernardi.com.au/media/editors/codemirror/mode/markdown/ |
Current File : //home1/lightco1/www/aldobernardi.com.au/media/editors/codemirror/mode/markdown/markdown.min.js |
!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(b,f){var h=b.sol(),i=f.list!==!1,j=f.indentedCode;f.indentedCode=!1,i&&(f.indentationDiff>=0?(f.indentationDiff<4&&(f.indentation-=f.indentationDiff),f.list=null):f.indentation>0?f.list=null:f.list=!1);var l=null;if(f.indentationDiff>=4)return b.skipToEnd(),j||g(f.prevLine)?(f.indentation-=4,f.indentedCode=!0,x.code):null;if(b.eatSpace())return null;if((l=b.match(D))&&l[1].length<=6)return f.header=l[1].length,c.highlightFormatting&&(f.formatting="header"),f.f=f.inline,m(f);if(!(g(f.prevLine)||f.quote||i||j)&&(l=b.match(E)))return f.header="="==l[0].charAt(0)?1:2,c.highlightFormatting&&(f.formatting="header"),f.f=f.inline,m(f);if(b.eat(">"))return f.quote=h?1:f.quote+1,c.highlightFormatting&&(f.formatting="quote"),b.eatSpace(),m(f);if("["===b.peek())return e(b,f,s);if(b.match(z,!0))return f.hr=!0,x.hr;if((g(f.prevLine)||i)&&(b.match(A,!1)||b.match(B,!1))){var n=null;for(b.match(A,!0)?n="ul":(b.match(B,!0),n="ol"),f.indentation=b.column()+b.current().length,f.list=!0;f.listStack&&b.column()<f.listStack[f.listStack.length-1];)f.listStack.pop();return f.listStack.push(f.indentation),c.taskLists&&b.match(C,!1)&&(f.taskList=!0),f.f=f.inline,c.highlightFormatting&&(f.formatting=["list","list-"+n]),m(f)}return c.fencedCodeBlocks&&(l=b.match(G,!0))?(f.fencedChars=l[1],f.localMode=d(l[2]),f.localMode&&(f.localState=a.startState(f.localMode)),f.f=f.block=k,c.highlightFormatting&&(f.formatting="code-block"),f.code=-1,m(f)):e(b,f,f.inline)}function j(b,c){var d=v.token(b,c.htmlState);if(!w){var e=a.innerMode(v,c.htmlState);("xml"==e.mode.name&&null===e.state.tagStart&&!e.state.context&&e.state.tokenize.isInText||c.md_inside&&b.current().indexOf(">")>-1)&&(c.f=o,c.block=i,c.htmlState=null)}return d}function k(a,b){return 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(),x.code)}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=1;var d=m(b);return b.code=0,d}function m(a){var b=[];if(a.formatting){b.push(x.formatting),"string"==typeof a.formatting&&(a.formatting=[a.formatting]);for(var d=0;d<a.formatting.length;d++)b.push(x.formatting+"-"+a.formatting[d]),"header"===a.formatting[d]&&b.push(x.formatting+"-"+a.formatting[d]+"-"+a.header),"quote"===a.formatting[d]&&(!c.maxBlockquoteDepth||c.maxBlockquoteDepth>=a.quote?b.push(x.formatting+"-"+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(x.linkHref,"url"):(a.strong&&b.push(x.strong),a.em&&b.push(x.em),a.strikethrough&&b.push(x.strikethrough),a.linkText&&b.push(x.linkText),a.code&&b.push(x.code),a.image&&b.push(x.image),a.imageAltText&&b.push(x.imageAltText,"link"),a.imageMarker&&b.push(x.imageMarker)),a.header&&b.push(x.header,x.header+"-"+a.header),a.quote&&(b.push(x.quote),!c.maxBlockquoteDepth||c.maxBlockquoteDepth>=a.quote?b.push(x.quote+"-"+a.quote):b.push(x.quote+"-"+c.maxBlockquoteDepth)),a.list!==!1){var e=(a.listStack.length-1)%3;e?1===e?b.push(x.list2):b.push(x.list3):b.push(x.list1)}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(F,!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(C,!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(d.linkTitle){d.linkTitle=!1;var k=i;"("===i&&(k=")"),k=(k+"").replace(/([.?*+^$[\]\\(){}|-])/g,"\\$1");var l="^\\s*(?:[^"+k+"\\\\]+|\\\\\\\\|\\\\.)"+k;if(b.match(new RegExp(l),!0))return x.linkHref}if("`"===i){var n=d.formatting;c.highlightFormatting&&(d.formatting="code"),b.eatWhile("`");var o=b.current().length;if(0==d.code)return d.code=o,m(d);if(o==d.code){var r=m(d);return d.code=0,r}return d.formatting=n,m(d)}if(d.code)return m(d);if("\\"===i&&(b.next(),c.highlightFormatting)){var s=m(d),t=x.formatting+"-escape";return s?s+" "+t:t}if("!"===i&&b.match(/\[[^\]]*\] ?(?:\(|\[)/,!1))return d.imageMarker=!0,d.image=!0,c.highlightFormatting&&(d.formatting="image"),m(d);if("["===i&&d.imageMarker)return d.imageMarker=!1,d.imageAltText=!0,c.highlightFormatting&&(d.formatting="image"),m(d);if("]"===i&&d.imageAltText){c.highlightFormatting&&(d.formatting="image");var s=m(d);return d.imageAltText=!1,d.image=!1,d.inline=d.f=q,s}if("["===i&&b.match(/[^\]]*\](\(.*\)| ?\[.*?\])/,!1)&&!d.image)return d.linkText=!0,c.highlightFormatting&&(d.formatting="link"),m(d);if("]"===i&&d.linkText&&b.match(/\(.*?\)| ?\[.*?\]/,!1)){c.highlightFormatting&&(d.formatting="link");var s=m(d);return d.linkText=!1,d.inline=d.f=q,s}if("<"===i&&b.match(/^(https?|ftps?):\/\/(?:[^\\>]|\\.)+>/,!1)){d.f=d.inline=p,c.highlightFormatting&&(d.formatting="link");var s=m(d);return s?s+=" ":s="",s+x.linkInline}if("<"===i&&b.match(/^[^> \\]+@(?:[^\\>]|\\.)+>/,!1)){d.f=d.inline=p,c.highlightFormatting&&(d.formatting="link");var s=m(d);return s?s+=" ":s="",s+x.linkEmail}if("<"===i&&b.match(/^(!--|\w)/,!1)){var u=b.string.indexOf(">",b.pos);if(-1!=u){var w=b.string.substring(b.start,u);/markdown\s*=\s*('|"){0,1}1('|"){0,1}/.test(w)&&(d.md_inside=!0)}return b.backUp(1),d.htmlState=a.startState(v),f(b,d,j)}if("<"===i&&b.match(/^\/\w*?>/))return d.md_inside=!1,"tag";var y=!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)&&(y=!0)}}if("*"===i||"_"===i&&!y)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+x.linkInline}return a.match(/^[^>]+/,!0),x.linkInline}function q(a,b){if(a.eatSpace())return null;var d=a.next();return"("===d||"["===d?(b.f=b.inline=r("("===d?")":"]",0),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(H[a]),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),x.linkText}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,x.linkHref+" url")}var v=a.getMode(b,"text/html"),w="null"==v.name;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),void 0===c.tokenTypeOverrides&&(c.tokenTypeOverrides={});var x={header:"header",code:"comment",quote:"quote",list1:"variable-2",list2:"variable-3",list3:"keyword",hr:"hr",image:"image",imageAltText:"image-alt-text",imageMarker:"image-marker",formatting:"formatting",linkInline:"link",linkEmail:"link",linkText:"link",linkHref:"string",em:"em",strong:"strong",strikethrough:"strikethrough"};for(var y in x)x.hasOwnProperty(y)&&c.tokenTypeOverrides[y]&&(x[y]=c.tokenTypeOverrides[y]);var z=/^([*\-_])(?:\s*\1){2,}\s*$/,A=/^[*\-+]\s+/,B=/^[0-9]+([.)])\s+/,C=/^\[(x| )\](?=\s)/,D=c.allowAtxHeaderWithoutSpace?/^(#+)/:/^(#+)(?: |$)/,E=/^ *(?:\={1,}|-{1,})\s*$/,F=/^[^#!\[\]*_\\<>` "'(~]+/,G=new RegExp("^("+(c.fencedCodeBlocks===!0?"~~~+|```+":c.fencedCodeBlocks)+")[ \\t]*([\\w+#-]*)"),H={")":/^(?:[^\\\(\)]|\\.|\((?:[^\\\(\)]|\\.)*\))*?(?=\))/,"]":/^(?:[^\\\[\]]|\\.|\[(?:[^\\\[\\]]|\\.)*\])*?(?=\])/},I={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,code:0,em:!1,strong:!1,header:0,hr:!1,taskList:!1,list:!1,listStack:[],quote:0,trailingSpace:0,trailingSpaceNewLine:!1,strikethrough:!1,fencedChars:null}},copyState:function(b){return{f:b.f,prevLine:b.prevLine,thisLine:b.thisLine,block:b.block,htmlState:b.htmlState&&a.copyState(v,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,listStack:b.listStack.slice(0),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;if(b.indentationDiff=Math.min(d-b.indentation,4),b.indentation=b.indentation+b.indentationDiff,d>0)return null}return b.f(a,b)},innerMode:function(a){return a.block==j?{state:a.htmlState,mode:v}:a.localState?{state:a.localState,mode:a.localMode}:{state:a,mode:I}},blankLine:h,getType:m,fold:"markdown"};return I},"xml"),a.defineMIME("text/x-markdown","markdown")});