From: Paul Hänsch Date: Sun, 20 Feb 2022 23:52:03 +0000 (+0100) Subject: markdown support for external macro plugin X-Git-Url: https://git.plutz.net/?a=commitdiff_plain;h=882f37daf3eac1ee8589eb623ec3bc4cfc3c7e9f;p=cgilite markdown support for external macro plugin --- diff --git a/markdown.awk b/markdown.awk index 361e600..65e0aef 100755 --- a/markdown.awk +++ b/markdown.awk @@ -227,6 +227,11 @@ function inline( line, LOCAL, len, code, href, guard ) { len = RLENGTH; return "" inline( substr( line, 2, len - 2 ) ) "" inline( substr( line, len + 1 ) ); + # Macros + } else if ( AllowMacros && match( line, /^<<([^>]|>[^>])+>>/) ) { + len = RLENGTH; + return macro( substr( line, 3, len - 4 ) ) inline(substr(line, len + 1)); + # Verbatim inline HTML } else if ( AllowHTML && match( line, /^(|<\?([^\?]|\?[^>])*\?>|]*>|])*\]\]>|<\/[A-Za-z][A-Za-z0-9-]*[[:space:]]*>|<[A-Za-z][A-Za-z0-9-]*([[:space:]]+[A-Za-z_:][A-Za-z0-9_\.:-]*([[:space:]]*=[[:space:]]*([[:space:]"'=<>`]+|"[^"]*"|'[^']*'))?)*[[:space:]]*\/?>)/) ) { len = RLENGTH;