X-Git-Url: https://git.plutz.net/?a=blobdiff_plain;f=cgilite%2Fmarkdown.awk;h=33c12bdc9a5be4bcccd3e5bf1b504182291b0c36;hb=08f0f74da3cd335f0acf58dc1f6370848dc1dbd8;hp=100242cb1ebb9b0e2a706a1025dbc552c51c190b;hpb=d5f49dcedc32f9eaa2932c0a9e9bf5ffbc92cab9;p=shellwiki diff --git a/cgilite/markdown.awk b/cgilite/markdown.awk index 100242c..33c12bd 100755 --- a/cgilite/markdown.awk +++ b/cgilite/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) );