diff --git a/bower.json b/bower.json index 79859659e..828045139 100644 --- a/bower.json +++ b/bower.json @@ -24,7 +24,7 @@ "ckeditor": "4.7.3", "codemirror": "^5.19.0", "requirejs": "2.3.5", - "marked": "0.3.5", + "marked": "0.5.0", "rangy": "rangy-release#~1.3.0", "json.sortify": "~2.1.0", "secure-fabric.js": "secure-v1.7.9", diff --git a/www/common/diffMarked.js b/www/common/diffMarked.js index c224b4072..2c29afa12 100644 --- a/www/common/diffMarked.js +++ b/www/common/diffMarked.js @@ -25,9 +25,11 @@ define([ // Tasks list var checkedTaskItemPtn = /^\s*(
)?\[[xX]\](<\/p>)?\s*/; var uncheckedTaskItemPtn = /^\s*(
)?\[ ?\](<\/p>)?\s*/; + var bogusCheckPtn = //; renderer.listitem = function (text) { var isCheckedTaskItem = checkedTaskItemPtn.test(text); var isUncheckedTaskItem = uncheckedTaskItemPtn.test(text); + var hasBogusInput = bogusCheckPtn.test(text); if (isCheckedTaskItem) { text = text.replace(checkedTaskItemPtn, ' ') + '\n'; @@ -36,6 +38,15 @@ define([ text = text.replace(uncheckedTaskItemPtn, ' ') + '\n'; } + if (!isCheckedTaskItem && !isUncheckedTaskItem && hasBogusInput) { + if (/checked/.test(text)) { + text = text.replace(bogusCheckPtn, + ' ') + '\n'; + } else if (/disabled/.test(text)) { + text = text.replace(bogusCheckPtn, + ' ') + '\n'; + } + } var cls = (isCheckedTaskItem || isUncheckedTaskItem) ? ' class="todo-list-item"' : ''; return '