diff options
1 files changed, 9 insertions, 1 deletions
| -rw-r--r-- | single.awk | 10 |
@@ -27,7 +27,7 @@ # [x] Superscript ^...^ # [x] Subscript ~...~ # [ ] Footnote [^...] (with user customizations) -# [ ] Task list - [ ] +# [x] Task list - [ ] (readonly) # [.] Definition lists # [x] Single line # [ ] Multi-line @@ -187,6 +187,14 @@ function autoinsert(arrname, isbefore) { /^( |\t)[ \t]*/ { } +# Check boxes +/^[ \t]*- \[[ x]\][ \t]/ { + match($0, /- \[[ x]\][ \t]/) + if (substr($0, RSTART + 3, 1) == "x") checked = " checked=\"checked\"" + else checked = "" + $0 = "<input type=\"checkbox\" disabled=\"disabled\"" checked ">" substr($0, RSTART + RLENGTH) "</br>" +} + # Unordered lists function abs(x) { return ((x < 0) ? -x : x) } !blankline && lengthStack("list-level") > 0 { |
