|
|
|
!function(e){"use strict";if("function"==typeof require&&"object"==typeof exports&&"object"==typeof module)module.exports=e;else if("function"==typeof define)if(define.amd){var t="codemirror/mode/",i="codemirror/addon/",o=["jquery","marked","prettify","katex","raphael","underscore","flowchart","jqueryflowchart","sequenceDiagram","codemirror/lib/codemirror",t+"css/css",t+"sass/sass",t+"shell/shell",t+"sql/sql",t+"clike/clike",t+"php/php",t+"xml/xml",t+"markdown/markdown",t+"javascript/javascript",t+"htmlmixed/htmlmixed",t+"gfm/gfm",t+"http/http",t+"go/go",t+"dart/dart",t+"coffeescript/coffeescript",t+"nginx/nginx",t+"python/python",t+"perl/perl",t+"lua/lua",t+"r/r",t+"ruby/ruby",t+"rst/rst",t+"smartymixed/smartymixed",t+"vb/vb",t+"vbscript/vbscript",t+"velocity/velocity",t+"xquery/xquery",t+"yaml/yaml",t+"erlang/erlang",t+"jade/jade",i+"edit/trailingspace",i+"dialog/dialog",i+"search/searchcursor",i+"search/search",i+"scroll/annotatescrollbar",i+"search/matchesonscrollbar",i+"display/placeholder",i+"edit/closetag",i+"fold/foldcode",i+"fold/foldgutter",i+"fold/indent-fold",i+"fold/brace-fold",i+"fold/xml-fold",i+"fold/markdown-fold",i+"fold/comment-fold",i+"mode/overlay",i+"selection/active-line",i+"edit/closebrackets",i+"display/fullscreen",i+"search/match-highlighter"];define(o,e)}else define(["jquery"],e);else window.editormd=e()}(function(){"function"==typeof define&&define.amd&&(e=arguments[0],marked=arguments[1],prettify=arguments[2],katex=arguments[3],Raphael=arguments[4],_=arguments[5],flowchart=arguments[6],CodeMirror=arguments[9]);var e="undefined"!=typeof jQuery?jQuery:Zepto;if("undefined"!=typeof e){var t=function(e,i){return new t.fn.init(e,i)};t.title=t.$name="Editor.md",t.version="1.3.0",t.homePage="https://pandao.github.io/editor.md/",t.classPrefix="editormd-",t.toolbarModes={full:["undo","redo","|","bold","del","italic","quote","ucwords","uppercase","lowercase","|","h1","h2","h3","h4","h5","h6","|","list-ul","list-ol","hr","|","link","anchor","image","code","preformatted-text","code-block","table","datetime","emoji","htmlEntities","|","watch","preview","fullscreen","clear","|","help","info"],simple:["undo","redo","|","bold","del","italic","quote","uppercase","lowercase","|","h1","h2","h3","h4","h5","h6","|","list-ul","list-ol","hr","|","watch","preview","fullscreen","|","help","info"],mini:["undo","redo","|","watch","preview","|","help","info"]},t.defaults={mode:"gfm",theme:"default",value:"",markdown:"",width:"100%",height:"100%",path:"./lib/",pluginPath:"",autoLoadModules:!0,watch:!0,placeholder:"now coding markdown...",codeFold:!1,autoHeight:!1,autoCloseTags:!0,searchReplace:!1,readOnly:!1,lineNumbers:!0,matchWordHighlight:!0,styleActiveLine:!0,dialogLockScreen:!0,dialogShowMask:!0,dialogDraggable:!0,dialogMaskBgColor:"#fff",dialogMaskOpacity:.1,fontSize:"13px",saveHTMLToTextarea:!1,disabledKeyMaps:[],onload:function(){},onresize:function(){},onchange:function(){},onwatch:null,onunwatch:null,onpreviewing:function(){},onpreviewed:function(){},onfullscreen:function(){},onfullscreenExit:function(){},onscroll:function(){},onpreviewscroll:function(){},imageUpload:!1,imageFormats:["jpg","jpeg","gif","png","bmp","webp"],imageUploadURL:"",crossDomainUpload:!1,uploadCallbackURL:"",toc:!0,tocStartLevel:1,htmlDecode:!1,atLink:!0,emailLink:!0,taskList:!1,emoji:!1,tex:!1,flowChart:!1,sequenceDiagram:!1,previewCodeHighlight:!0,toolbar:!0,toolbarAutoFixed:!0,toolbarIcons:function(){return t.toolbarModes.full},toolbarTitles:{},toolbarHandlers:{ucwords:function(){return t.toolbarHandlers.ucwords},lowercase:function(){return t.toolbarHandlers.lowercase}},toolbarCustomIcons:{lowercase:'<a href="javascript:;" title="Lowercase" unselectable="on"><i class="fa" name="lowercase" style="font-size:24px;margin-top: -10px;">a</i></a>',ucwords:'<a href="javascript:;" title="ucwords" unselectable="on"><i class="fa" name="ucwords" style="font-size:20px;margin-top: -3px;">Aa</i></a>'},toolbarIconsClass:{undo:"fa-undo",redo:"fa-repeat",bold:"fa-bold",del:"fa-strikethrough",italic:"fa-italic",quote:"fa-quote-left",uppercase:"fa-font",h
|
|
|
|
},"Shift-Ctrl-Alt-C":"code-block","Shift-Ctrl-H":"htmlEntities","Shift-Alt-H":"help","Shift-Ctrl-E":"emoji","Shift-Ctrl-U":"uppercase","Shift-Alt-U":"ucwords","Shift-Ctrl-Alt-U":"ucfirst","Shift-Alt-L":"lowercase","Shift-Ctrl-I":function(){var e=this.cm,t=e.getCursor(),i=e.getSelection(),o=""===i?"":' "'+i+'"';e.replaceSelection("!["+i+"]("+o+")"),""===i&&e.setCursor(t.line,t.ch+4)},"Shift-Ctrl-Alt-I":"image","Shift-Ctrl-L":"link","Shift-Ctrl-O":"list-ol","Shift-Ctrl-P":"preformatted-text","Shift-Ctrl-T":"table",F9:"watch",F10:"preview",F11:"fullscreen"};var i=function(e){return String.prototype.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"")};t.trim=i;var o=function(e){return e.toLowerCase().replace(/\b(\w)|\s(\w)/g,function(e){return e.toUpperCase()})};t.ucwords=t.wordsFirstUpperCase=o;var r=function(e){return e.toLowerCase().replace(/\b(\w)/,function(e){return e.toUpperCase()})};return t.firstUpperCase=t.ucfirst=r,t.urls={atLinkBase:"https://github.com/"},t.regexs={atLink:/@(\w+)/g,email:/(\w+)@(\w+)\.(\w+)\.?(\w+)?/g,emailLink:/(mailto:)?([\w\.\_]+)@(\w+)\.(\w+)\.?(\w+)?/g,emoji:/:([\-\w]+):/g,emojiDatetime:/(\d{2}:\d{2}:\d{2})/g,twemoji:/:(tw-([\w]+)-?(\w+)?):/g,fontAwesome:/:(fa-([\w]+)(-(\w+)){0,}):/g,editormdLogo:/:(editormd-logo-?(\w+)?):/g},t.emoji={path:"http://www.emoji-cheat-sheet.com/graphics/emojis/",ext:".png"},t.twemoji={path:"http://twemoji.maxcdn.com/36x36/",ext:".png"},t.markedRenderer=function(o,r){var a={toc:!0,tocStartLevel:1,atLink:!0,emailLink:!0,taskList:!1,emoji:!1,tex:!1,flowChart:!1,sequenceDiagram:!1},n=e.extend(a,r||{}),s=t.$marked,l=new s.Renderer;o=o||[];var c=t.regexs.atLink,d=t.regexs.emoji,h=t.regexs.email,u=t.regexs.emailLink,f=t.regexs.twemoji,g=t.regexs.fontAwesome,p=t.regexs.editormdLogo;return l.emoji=function(e){e=e.replace(t.regexs.emojiDatetime,function(e){return e.replace(/:/g,":")});var i=e.match(d);if(!i||!n.emoji)return e;for(var o=0,r=i.length;r>o;o++)e=e.replace(new RegExp(i[o]),function(e){var i=e.match(g),o=e.replace(/:/g,"");if(i)for(var r=0,a=i.length;a>r;r++){var n=i[r].replace(/:/g,"");return'<i class="fa '+n+' fa-emoji" title="'+n.replace("fa-","")+'"></i>'}else{var s=e.match(p),l=e.match(f);if(s)for(var c=0,d=s.length;d>c;c++){var h=s[c].replace(/:/g,"");return'<i class="'+h+'" title="Editor.md logo ('+h+')"></i>'}else{if(!l)return'<img src="'+t.emoji.path+o+t.emoji.ext+'" class="emoji" title=":'+o+':" alt=":'+o+':" />';for(var u=0,m=l.length;m>u;u++){var w=l[u].replace(/:/g,"").replace("tw-","");return'<img src="'+t.twemoji.path+w+t.twemoji.ext+'" title="twemoji-'+w+'" alt="twemoji-'+w+'" class="emoji twemoji" />'}}}});return e},l.atLink=function(e){return c.test(e)?(n.atLink&&(e=e.replace(h,function(e){return e.replace(/@/g,"_#_@_#_")}),e=e.replace(c,function(e,i){return'<a href="'+t.urls.atLinkBase+i+'" title="@'+i+'" class="at-link">'+e+"</a>"}).replace(/_#_@_#_/g,"@")),n.emailLink&&(e=e.replace(u,function(e,t){return t?e:'<a href="mailto:'+e+'">'+e+"</a>"})),e):e},l.link=function(e,t,i){if(this.options.sanitize){try{var o=decodeURIComponent(unescape(e)).replace(/[^\w:]/g,"").toLowerCase()}catch(r){return""}if(0===o.indexOf("javascript:"))return""}var a='<a href="'+e+'"';return c.test(t)||c.test(i)?(t&&(a+=' title="'+t.replace(/@/g,"@")),a+'">'+i.replace(/@/g,"@")+"</a>"):(t&&(a+=' title="'+t+'"'),a+=">"+i+"</a>")},l.heading=function(e,t){var r=e,a=/\s*\<a\s*href\=\"(.*)\"\s*([^\>]*)\>(.*)\<\/a\>\s*/;if(a.test(e)){var n=[];e=e.split(/\<a\s*([^\>]+)\>([^\>]*)\<\/a\>/);for(var s=0,l=e.length;l>s;s++)n.push(e[s].replace(/\s*href\=\"(.*)\"\s*/g,""));e=n.join(" ")}e=i(e);var c=e.toLowerCase().replace(/[^\w]+/g,"-"),d={text:e,level:t,slug:c},h=/^[\u4e00-\u9fa5]+$/.test(e),u=h?escape(e).replace(/\%/g,""):e.toLowerCase().replace(/[^\w]+/g,"-");o.push(d);var f="<h"+t+' id="h'+t+"-"+this.options.headerPrefix+u+'">';return f+='<a name="'+e+'" class="anchor"></a>',f+='<span class="header-link octicon octicon-link"></span>',f+=this.atLink(a?this.emoji(r):this.emoji(e)),f+="</h"+t+">"},l.paragraph=function(e){var i=/
|