]> git.plutz.net Git - cgilite/blobdiff - markdown.awk
fix: block nesting in lists
[cgilite] / markdown.awk
index 949ea9390f8450e8982b10945854f29076bde118..5915f011ece716dc8ab33825017226bf368e3a19 100755 (executable)
@@ -761,9 +761,9 @@ function _list (block, mark, LOCAL, len, st, text, indent, task) {
          match( text, /^\[\/\]/  ) ? "<li class=\"task partial\"><input type=checkbox disabled>"      : \
          match( text, /^\[\?\]/  ) ? "<li class=\"task unsure\"><input type=checkbox disabled>"       : \
          match( text, /^\[[xX]\]/) ? "<li class=\"task done\"><input type=checkbox disabled checked>" : "<li>";
-  sub(/^\[[- /xX]\]/, "", text);
+  sub(/^\[[-? /xX]\]/, "", text);
 
-  text = _block( text );
+  text = _nblock( text );
   if (match( text, "^<p>(</p[^>]|</[^p]|<[^/]|[^<])*</p>\n$" ))
      gsub( "(^<p>|</p>\n$)", "", text);
 
@@ -786,7 +786,7 @@ function _dlist (block, LOCAL, len, st, text, indent, p) {
     sub( "^ ? ? ?:(\t| +)", "", text);
     gsub( "(^|\n) {0," indent "}", "\n", text );
 
-    text = _block(text);
+    text = _nblock(text);
     if (match( text, "^<p>(</p[^>]|</[^p]|<[^/]|[^<])*</p>\n$" ))
        gsub( "(^<p>|</p>\n$)", "", text);