# - ? Grid table (pandoc)
# - ? Pipe table (php md pandoc)
# - [x] Line blocks (pandoc)
-# - [x] Task lists (pandoc)
+# - [x] Task lists (pandoc, custom)
# - [ ] Definition lists (php md, pandoc)
# - [-] Numbered example lists (pandoc)
# - [-] Metadata blocks (pandoc)
}
sub( /\n$/, "", p );
- # Task List (pandoc)
- if ( p ~ /^\[ \].*/ ) { p = "<input type=checkbox disabled />" substr(p, 4); }
- else if ( p ~ /^\[[xX]\].*/ ) { p = "<input type=checkbox disabled checked />" substr(p, 4); }
- else if ( p ~ /^<p>\[ \].*/ ) { p = "<p><input type=checkbox disabled />" substr(p, 7); }
- else if ( p ~ /^<p>\[[xX]\].*/ ) { p = "<p><input type=checkbox disabled checked />" substr(p, 7); }
- return "<li>" p "</li>\n" _list( block, last );
+ # Task List (pandoc, custom)
+ if ( p ~ /^\[ \].*/ ) { return "<li class=\"task pending\"><input type=checkbox disabled />" \
+ substr(p, 4) "</li>\n" _list( block, last );
+ } else if ( p ~ /^\[-\].*/ ) { return "<li class=\"task negative\"><input type=checkbox disabled />" \
+ substr(p, 4) "</li>\n" _list( block, last );
+ } else if ( p ~ /^\[\?\].*/ ) { return "<li class=\"task unsure\"><input type=checkbox disabled />" \
+ substr(p, 4) "</li>\n" _list( block, last );
+ } else if ( p ~ /^\[\/\].*/ ) { return "<li class=\"task partial\"><input type=checkbox disabled />" \
+ substr(p, 4) "</li>\n" _list( block, last );
+ } else if ( p ~ /^\[[xX]\].*/ ) { return "<li class=\"task done\"><input type=checkbox disabled checked />" \
+ substr(p, 4) "</li>\n" _list( block, last );
+ } else if ( p ~ /^<p>\[ \].*/ ) { return "<li class=\"task pending\"><p><input type=checkbox disabled />" \
+ substr(p, 7) "</li>\n" _list( block, last );
+ } else if ( p ~ /^<p>\[-\].*/ ) { return "<li class=\"task negative\"><p><input type=checkbox disabled />" \
+ substr(p, 7) "</li>\n" _list( block, last );
+ } else if ( p ~ /^<p>\[\?\].*/ ) { return "<li class=\"task unsure\"><p><input type=checkbox disabled />" \
+ substr(p, 7) "</li>\n" _list( block, last );
+ } else if ( p ~ /^<p>\[\/\].*/ ) { return "<li class=\"task partial\"><p><input type=checkbox disabled />" \
+ substr(p, 7) "</li>\n" _list( block, last );
+ } else if ( p ~ /^<p>\[[xX]\].*/ ) { return "<li class=\"task done\"><p><input type=checkbox disabled checked />" \
+ substr(p, 7) "</li>\n" _list( block, last );
+ } else { return "<li>" p "</li>\n" _list( block, last ); }
}
BEGIN {