diff --git a/_includes/refactor-content.html b/_includes/refactor-content.html index 876d66e..1e44de3 100644 --- a/_includes/refactor-content.html +++ b/_includes/refactor-content.html @@ -4,24 +4,33 @@ {% assign _content = include.content %} - + {% if _content contains '' %} - {% assign _content = _content | replace: '
', '
' %} - {% assign _content = _content | replace: '
', '' %} - {% assign _content = _content | replace: '', '' %} + {% assign _content = _content + | replace: '', '
' + | replace: '
', '' + | replace: '', '' + %} {% endif %} - {% if _content contains '
' %}
-  {% assign _content = _content | replace: '
', '' %} + {% assign _content = _content + | replace: '
', '' + %} {% endif %} + +{% if _content contains '
  • <' %} + {% assign _content = _content + | replace: '"task-list-item"><', '"task-list-item" hide-bullet><' + %} +{% endif %} + + {{ _content }} diff --git a/assets/css/_addon/main.scss b/assets/css/_addon/main.scss index f88615a..ab8bd9f 100644 --- a/assets/css/_addon/main.scss +++ b/assets/css/_addon/main.scss @@ -866,7 +866,7 @@ div.post-content .table-wrapper { padding-left: 2rem; } - // attribute 'hide-bullet' added by JS + // attribute 'hide-bullet' was added by liquid .task-list-item[hide-bullet] { list-style-type: none; @@ -898,10 +898,12 @@ div.post-content .table-wrapper { } } } + } // .task-list-item input[type=checkbox] { - display: none; + margin: 0 .5rem .2rem -1.3rem; + vertical-align: middle; } } // ul diff --git a/assets/js/_commons/checkbox.js b/assets/js/_commons/checkbox.js index 39d9d38..93ab6d1 100644 --- a/assets/js/_commons/checkbox.js +++ b/assets/js/_commons/checkbox.js @@ -3,10 +3,10 @@ */ $(function() { - /* hide bullet of checkbox item */ - $("li.task-list-item:has(input)").attr("hide-bullet", ""); + /* hide browser default checkbox */ + $("input[type=checkbox]").addClass("unloaded"); /* create checked checkbox */ - $("input[type=checkbox][checked=checked]").before(""); + $("input[type=checkbox][checked]").before(""); /* create normal checkbox */ - $("input[type=checkbox]:not([checked=checked])").before(""); + $("input[type=checkbox]:not([checked])").before(""); });