" + this.atLink(this.emoji(text)) + "
\n" ); }; - markedRenderer.code = function (code, lang, escaped) { + markedRenderer.code = function (code, lang) { if (lang === "seq" || lang === "sequence") { @@ -3879,7 +3877,7 @@ editormd.filterHTMLTags = function(html, filters) { if (typeof html !== "string") { - html = new String(html); + html = html.toString(); } if (typeof filters !== "string") { @@ -3917,7 +3915,9 @@ var $attrs = {}; $.each(_attrs, function(i, e) { - if (e.nodeName !== '"') $attrs[e.nodeName] = e.nodeValue; + if (e.nodeName !== "\"") { + $attrs[e.nodeName] = e.nodeValue; + } }); $.each($attrs, function(i) { @@ -3988,9 +3988,9 @@ editormd.$marked = marked; var div = $("#" + id); - var settings = div.settings = $.extend(true, defaults, options || {}); + var settings = div.settings = $.extend(true, {}, defaults, options || {}); var saveTo = div.find("textarea"); - + if (saveTo.length < 1) { div.append(""); @@ -4025,13 +4025,13 @@ smartLists : true, smartypants : true }; - - markdownDoc = new String(markdownDoc); - + + markdownDoc = markdownDoc.toString(); + var markdownParsed = marked(markdownDoc, markedOptions); - + markdownParsed = editormd.filterHTMLTags(markdownParsed, settings.htmlDecode); - + if (settings.markdownSourceCode) { saveTo.text(markdownDoc); } else { @@ -4192,9 +4192,9 @@ document.body.appendChild(css); } }; - - editormd.isIE = (navigator.appName == "Microsoft Internet Explorer"); - editormd.isIE8 = (editormd.isIE && navigator.appVersion.match(/8./i) == "8."); + + editormd.isIE = (navigator.appName === "Microsoft Internet Explorer"); + editormd.isIE8 = (editormd.isIE && navigator.appVersion.match(/8./i) === "8."); /** * 动态加载JS文件的方法 @@ -4248,10 +4248,10 @@ // 使用国外的CDN,加载速度有时会很慢,或者自定义URL // You can custom KaTeX load url. editormd.katexURL = { - css : "//cdnjs.cloudflare.com/ajax/libs/KaTeX/0.3.0/katex.min", - js : "//cdnjs.cloudflare.com/ajax/libs/KaTeX/0.3.0/katex.min" + css : "https://cdnjs.cloudflare.com/ajax/libs/KaTeX/0.10.1/katex.min", + js : "https://cdnjs.cloudflare.com/ajax/libs/KaTeX/0.10.1/katex.min" }; - + editormd.kaTeXLoaded = false; /** @@ -4295,6 +4295,7 @@ title : "", drag : true, closed : true, + cached : false, content : "", mask : true, maskStyle : { @@ -4313,8 +4314,6 @@ var classPrefix = editormd.classPrefix; var guid = (new Date()).getTime(); var dialogName = ( (options.name === "") ? classPrefix + "dialog-" + guid : options.name); - var mouseOrTouch = editormd.mouseOrTouch; - var html = ""+this.atLink(this.emoji(e))+"
\n"},l.code=function(e,i,o){return"seq"===i||"sequence"===i?''+e+"
":s.Renderer.prototype.code.apply(this,arguments)},l.tablecell=function(e,t){var i=t.header?"th":"td",o=t.align?"<"+i+' style="text-align:'+t.align+'">':"<"+i+">";return o+this.atLink(this.emoji(e))+""+i+">\n"},l.listitem=function(e){return a.taskList&&/^\s*\[[x\s]\]\s*/.test(e)?(e=e.replace(/^\s*\[\s\]\s*/,' ').replace(/^\s*\[x\]\s*/,' '),'"+this.atLink(this.emoji(e))+"
\n"},l.code=function(e,i){return"seq"===i||"sequence"===i?''+e+"
":s.Renderer.prototype.code.apply(this,arguments)},l.tablecell=function(e,t){var i=t.header?"th":"td";return(t.align?"<"+i+' style="text-align:'+t.align+'">':"<"+i+">")+this.atLink(this.emoji(e))+""+i+">\n"},l.listitem=function(e){return n.taskList&&/^\s*\[[x\s]\]\s*/.test(e)?(e=e.replace(/^\s*\[\s\]\s*/,' ').replace(/^\s*\[x\]\s*/,' '),'" + this.atLink(this.emoji(text)) + "
\n" ); }; - markedRenderer.code = function (code, lang, escaped) { + markedRenderer.code = function (code, lang) { if (lang === "seq" || lang === "sequence") { @@ -3810,7 +3807,7 @@ editormd.filterHTMLTags = function(html, filters) { if (typeof html !== "string") { - html = new String(html); + html = html.toString(); } if (typeof filters !== "string") { @@ -3848,7 +3845,9 @@ var $attrs = {}; $.each(_attrs, function(i, e) { - if (e.nodeName !== '"') $attrs[e.nodeName] = e.nodeValue; + if (e.nodeName !== "\"") { + $attrs[e.nodeName] = e.nodeValue; + } }); $.each($attrs, function(i) { @@ -3919,9 +3918,9 @@ editormd.$marked = marked; var div = $("#" + id); - var settings = div.settings = $.extend(true, defaults, options || {}); + var settings = div.settings = $.extend(true, {}, defaults, options || {}); var saveTo = div.find("textarea"); - + if (saveTo.length < 1) { div.append(""); @@ -3956,13 +3955,13 @@ smartLists : true, smartypants : true }; - - markdownDoc = new String(markdownDoc); - + + markdownDoc = markdownDoc.toString(); + var markdownParsed = marked(markdownDoc, markedOptions); - + markdownParsed = editormd.filterHTMLTags(markdownParsed, settings.htmlDecode); - + if (settings.markdownSourceCode) { saveTo.text(markdownDoc); } else { @@ -4123,9 +4122,9 @@ document.body.appendChild(css); } }; - - editormd.isIE = (navigator.appName == "Microsoft Internet Explorer"); - editormd.isIE8 = (editormd.isIE && navigator.appVersion.match(/8./i) == "8."); + + editormd.isIE = (navigator.appName === "Microsoft Internet Explorer"); + editormd.isIE8 = (editormd.isIE && navigator.appVersion.match(/8./i) === "8."); /** * 动态加载JS文件的方法 @@ -4179,10 +4178,10 @@ // 使用国外的CDN,加载速度有时会很慢,或者自定义URL // You can custom KaTeX load url. editormd.katexURL = { - css : "//cdnjs.cloudflare.com/ajax/libs/KaTeX/0.3.0/katex.min", - js : "//cdnjs.cloudflare.com/ajax/libs/KaTeX/0.3.0/katex.min" + css : "https://cdnjs.cloudflare.com/ajax/libs/KaTeX/0.10.1/katex.min", + js : "https://cdnjs.cloudflare.com/ajax/libs/KaTeX/0.10.1/katex.min" }; - + editormd.kaTeXLoaded = false; /** @@ -4226,6 +4225,7 @@ title : "", drag : true, closed : true, + cached : false, content : "", mask : true, maskStyle : { @@ -4244,8 +4244,6 @@ var classPrefix = editormd.classPrefix; var guid = (new Date()).getTime(); var dialogName = ( (options.name === "") ? classPrefix + "dialog-" + guid : options.name); - var mouseOrTouch = editormd.mouseOrTouch; - var html = ""+this.atLink(this.emoji(e))+"
\n"},l.code=function(e,i,o){return"seq"===i||"sequence"===i?''+e+"
":s.Renderer.prototype.code.apply(this,arguments)},l.tablecell=function(e,t){var i=t.header?"th":"td",o=t.align?"<"+i+' style="text-align:'+t.align+'">':"<"+i+">";return o+this.atLink(this.emoji(e))+""+i+">\n"},l.listitem=function(e){return a.taskList&&/^\s*\[[x\s]\]\s*/.test(e)?(e=e.replace(/^\s*\[\s\]\s*/,' ').replace(/^\s*\[x\]\s*/,' '),'"+this.atLink(this.emoji(e))+"
\n"},l.code=function(e,i){return"seq"===i||"sequence"===i?''+e+"
":s.Renderer.prototype.code.apply(this,arguments)},l.tablecell=function(e,t){var i=t.header?"th":"td";return(t.align?"<"+i+' style="text-align:'+t.align+'">':"<"+i+">")+this.atLink(this.emoji(e))+""+i+">\n"},l.listitem=function(e){return a.taskList&&/^\s*\[[x\s]\]\s*/.test(e)?(e=e.replace(/^\s*\[\s\]\s*/,' ').replace(/^\s*\[x\]\s*/,' '),'