X-Git-Url: https://git.plutz.net/?p=cgilite;a=blobdiff_plain;f=markdown.awk;h=b5072666de89f34c4b425211b70dd7471b0d9f21;hp=fa60543b49d43ed013325bf939e2d93ed22e7a5b;hb=01dadd76ff332d89503364a794423564f01805ea;hpb=697a1bb3a7823c889abe31df5168a57dd11f37d4 diff --git a/markdown.awk b/markdown.awk index fa60543..b507266 100755 --- a/markdown.awk +++ b/markdown.awk @@ -608,6 +608,12 @@ function _block( block, LOCAL, st, len, hlvl, htxt, guard, code, indent, attrib return "

" HTML(substr(block, 1, len)) "

\n" _block( substr(block, len + 1) ); } + # Macros (standalone <> calls handled as block, so they are not wrapped in paragraph) + } else if ( AllowMacros && match( block, /^<<(([^>]|>[^>])+)>>(\n|$)/) ) { + len = RLENGTH; + text = gensub(/^<<(([^>]|>[^>])+)>>(\n.*)?$/, "\\1", 1, block); + return macro(text) _block(substr(block, len + 1)); + # Split paragraphs } else if ( match( block, /(^|\n)[[:space:]]*(\n|$)/) ) { len = RLENGTH; st = RSTART;