From: Paul Hänsch Date: Sun, 20 Feb 2022 23:53:53 +0000 (+0100) Subject: Squashed 'cgilite/' changes from 1d27862..882f37d X-Git-Url: https://git.plutz.net/?a=commitdiff_plain;h=11b24625989e65362b0d4e4aae3c12cbced8338b;p=shellwiki Squashed 'cgilite/' changes from 1d27862..882f37d 882f37d markdown support for external macro plugin git-subtree-dir: cgilite git-subtree-split: 882f37daf3eac1ee8589eb623ec3bc4cfc3c7e9f --- 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;