]> git.plutz.net Git - cgilite/commitdiff
bugfix: allow trailing white space in indented code
authorPaul Hänsch <paul@plutz.net>
Sun, 26 Jun 2022 18:21:34 +0000 (20:21 +0200)
committerPaul Hänsch <paul@plutz.net>
Sun, 26 Jun 2022 18:21:34 +0000 (20:21 +0200)
markdown.awk

index f06977c88b690ee17d80b979fb3fc6f1ec653c87..ccd4cde125a238cb8ddb07e7293d00347f0dbecc 100755 (executable)
@@ -416,7 +416,7 @@ function _block( block, LOCAL, st, len, hlvl, htxt, guard, code, indent, attrib
            _block( substr( block, len + 1) );
 
   # Indented Code Block
-  } else if ( match(block, /^(    |\t)( *\t*[^ \t\n])+(\n|$)((    |\t)[^\n]+(\n|$)|[ \t]*(\n|$))*/) ) {
+  } else if ( match(block, /^(    |\t)( *\t*[^ \t\n]+ *\t*)+(\n|$)((    |\t)[^\n]+(\n|$)|[ \t]*(\n|$))*/) ) {
     len = RLENGTH; st = RSTART;
     code = substr(block, 1, len);
     gsub(/(^|\n)(    |\t)/, "\n", code);