bugfix in recognition of fenced code block attributes
authorPaul Hänsch <paul@plutz.net>
Tue, 31 May 2022 19:13:47 +0000 (21:13 +0200)
committerPaul Hänsch <paul@plutz.net>
Tue, 31 May 2022 19:13:47 +0000 (21:13 +0200)
markdown.awk

index 4ef7645..540292c 100755 (executable)
@@ -337,7 +337,7 @@ function _block( block, LOCAL, st, len, hlvl, htxt, guard, code, indent, attrib
   } else if ( match( block, /^(~~~+|```+)/ ) ) {
     guard = substr( block, 1, RLENGTH );
     code = gensub(/^[^\n]+\n/, "", 1, block);
-    attrib = gensub(/^:::+[ \t]*\{?[ \t]*([^\}\n]*)\}?[ \t]*\n.*$/, "\\1", 1, block);
+    attrib = gensub(/^(~~~+|```+)[ \t]*\{?[ \t]*([^\}\n]*)\}?[ \t]*\n.*$/, "\\2", 1, block);
     gsub(/[^a-zA-Z0-9_-]+/, " ", attrib);
     gsub(/(^ | $)/, "", attrib);
     if ( match(code, "(^|\n)" guard "+(\n|$)" ) ) {