From: Paul Hänsch Date: Tue, 30 May 2023 15:12:05 +0000 (+0200) Subject: Squashed 'cgilite/' changes from fa6be3f1..d45e2c8b X-Git-Url: https://git.plutz.net/?a=commitdiff_plain;h=1b5b1676f9f6869aec5cd141a9670e12ccd28b5d;p=shellwiki Squashed 'cgilite/' changes from fa6be3f1..d45e2c8b d45e2c8b wiki style links: portability regex fix git-subtree-dir: cgilite git-subtree-split: d45e2c8bfc3c107cffc6771eae97988e11b2ceb5 --- diff --git a/markdown.awk b/markdown.awk index 100242c..33c12bd 100755 --- a/markdown.awk +++ b/markdown.awk @@ -137,10 +137,10 @@ function inline( line, LOCAL, len, code, href, guard ) { } # Wiki style links - } else if ( match( line, /^\[\[([^\]\|]+)(\|([^\]]+))?\]\]/) ) { + } else if ( match( line, /^\[\[([^]|]+)(\|[^]]+)?\]\]/) ) { len = RLENGTH; - href = gensub(/^\[\[([^\]\|]+)(\|([^\]]+))?\]\]/, "\\1", 1, substr(line, 1, len) ); - text = gensub(/^\[\[([^\]\|]+)(\|([^\]]+))?\]\]/, "\\3", 1, substr(line, 1, len) ); + href = gensub(/^\[\[([^]|]+)(\|([^]]+))?\]\]/, "\\1", 1, substr(line, 1, len) ); + text = gensub(/^\[\[([^]|]+)(\|([^]]+))?\]\]/, "\\3", 1, substr(line, 1, len) ); if ( ! text ) text = href; return "" HTML(text) "" inline( substr( line, len + 1) );