]> git.plutz.net Git - cgilite/commitdiff
fix: block nesting in lists
authorPaul Hänsch <paul@plutz.net>
Tue, 29 Aug 2023 22:37:43 +0000 (00:37 +0200)
committerPaul Hänsch <paul@plutz.net>
Tue, 29 Aug 2023 22:37:43 +0000 (00:37 +0200)
markdown.awk

index 91a7956c96cb67e5667b9291b930843d3e0a1376..5915f011ece716dc8ab33825017226bf368e3a19 100755 (executable)
@@ -763,7 +763,7 @@ function _list (block, mark, LOCAL, len, st, text, indent, task) {
          match( text, /^\[[xX]\]/) ? "<li class=\"task done\"><input type=checkbox disabled checked>" : "<li>";
   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);