diff --git a/editormd.amd.js b/editormd.amd.js index 0014dd8..5158639 100644 --- a/editormd.amd.js +++ b/editormd.amd.js @@ -2105,6 +2105,10 @@ { previewContainer.html(newMarkdownDoc); + previewContainer.find(".task-list-item").each(function () { + $(this).parent().addClass("task-list"); + }); + this.previewCodeHighlight(); if (settings.toc) @@ -3723,16 +3727,12 @@ return tag + this.atLink(this.emoji(content)) + "" + type + ">\n"; }; - markedRenderer.listitem = function(text) { - if (settings.taskList && /^\s*\[[x\s]\]\s*/.test(text)) - { - text = text.replace(/^\s*\[\s\]\s*/, " ") - .replace(/^\s*\[x\]\s*/, " "); + markedRenderer.listitem = function(text, task) { + if (settings.taskList && task) { + text = text.replace("" + this.atLink(this.emoji(text)) + ""; - } - else - { + return "
"+this.lang.description+"
",'','Copyright © 2015-'+t.dateFormat("yyyy")+' Pandao, The MIT License.
',""+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.lang.description+"
",'','Copyright © 2015-'+t.dateFormat("yyyy")+' Pandao, The MIT License.
',""+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,t){return n.taskList&&t?(e=e.replace("'+this.atLink(this.emoji(e))+""):""+this.lang.description+"
",'','Copyright © 2015-'+t.dateFormat("yyyy")+' Pandao, The MIT License.
',""+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.lang.description+"
",'','Copyright © 2015-'+t.dateFormat("yyyy")+' Pandao, The MIT License.
',""+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,t){return n.taskList&&t?(e=e.replace("'+this.atLink(this.emoji(e))+""):"