diff --git a/www/common/diffMarked.js b/www/common/diffMarked.js index 783aa78a9..73c801ab4 100644 --- a/www/common/diffMarked.js +++ b/www/common/diffMarked.js @@ -117,29 +117,30 @@ define([ // Tasks list var checkedTaskItemPtn = /^\s*(

)?\[[xX]\](<\/p>)?\s*/; var uncheckedTaskItemPtn = /^\s*(

)?\[ ?\](<\/p>)?\s*/; - var bogusCheckPtn = //; + var bogusCheckPtn = //; + var bogusUncheckPtn = //; renderer.listitem = function (text) { var isCheckedTaskItem = checkedTaskItemPtn.test(text); var isUncheckedTaskItem = uncheckedTaskItemPtn.test(text); - var hasBogusInput = bogusCheckPtn.test(text); + var hasBogusCheckedInput = bogusCheckPtn.test(text); + var hasBogusUncheckedInput = bogusUncheckPtn.test(text); + var isCheckbox = true; if (isCheckedTaskItem) { text = text.replace(checkedTaskItemPtn, '') + '\n'; - } - if (isUncheckedTaskItem) { + } else if (isUncheckedTaskItem) { text = text.replace(uncheckedTaskItemPtn, '') + '\n'; - } - if (!isCheckedTaskItem && !isUncheckedTaskItem && hasBogusInput) { - if (/checked/.test(text)) { - text = text.replace(bogusCheckPtn, + } else if (hasBogusCheckedInput) { + text = text.replace(bogusCheckPtn, '') + '\n'; - } else if (/disabled/.test(text)) { - text = text.replace(bogusCheckPtn, + } else if (hasBogusUncheckedInput) { + text = text.replace(bogusUncheckPtn, '') + '\n'; - } + } else { + isCheckbox = false; } - var cls = (isCheckedTaskItem || isUncheckedTaskItem || hasBogusInput) ? ' class="todo-list-item"' : ''; + var cls = (isCheckbox) ? ' class="todo-list-item"' : ''; return '' + text + '\n'; }; restrictedRenderer.listitem = function (text) {