Summary Files Commits Branches @commit @diff @stats
path: root / single.awk
diff options
context:
space:
mode:
1 files changed, 8 insertions, 1 deletions
-rw-r--r--single.awk9
diff --git a/single.awk b/single.awk
index 0481a49..b4b4c89 100644
--- a/single.awk
+++ b/single.awk
@@ -11,7 +11,7 @@
# [x] Superscript ^...^
# [x] Subscript ~...~
# [ ] Footnote [^...] (with user customizations)
-# [ ] Task list - [ ] (readonly)
+# [x] Task list - [ ] (readonly)
# [ ] Definition lists
# [ ] Single line
# [ ] Multi-line
@@ -219,6 +219,13 @@ list_level > 0 && !list_started && /[^ \t]/ { ## Non-list line
}
}
+# Checklists
+list_started && /^\[[x ]\][ \t]/ {
+ checked = (char($0, 2) == "x") ? " checked=\"checked\"" : "";
+ $0 = "<input type=\"checkbox\" disabled=\"disabled\"" checked \
+ "><label>" substr($0, 5) "</label>"
+}
+
# Code blocks
/^( |\t)/ {
if (!inside_codeblock) {