]> git.plutz.net Git - cgilite/commitdiff
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 4ef76453515c9c1ec0a8ca72db3ac99250ca2b9b..540292c5cfbedd31875114e7d9cca073f3d629ff 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|$)" ) ) {