diff options
| Commit | 707916075efadc55ce432095c333b3025cd01321 (patch) | |
|---|---|---|
| Author | 2024-07-23 18:19:26 +0300 | |
| Committer | 2024-07-23 18:19:26 +0300 | |
| Files | 99d52412bc64764ba541ea1f6a5633a059192f2b /single.awk | |
| csg-707916075efadc55ce432095c333b3025cd01321.tar csg-707916075efadc55ce432095c333b3025cd01321.tar.gz csg-707916075efadc55ce432095c333b3025cd01321.zip | ||
| Parent | e42c3000981b928aa1d1bab23855fe2f0bfc5db4 (diff) | |
(single) Implemented reaodnly task lists
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 { |
