]> git.plutz.net Git - shellwiki/commitdiff
Merge commit '1b5b1676f9f6869aec5cd141a9670e12ccd28b5d'
authorPaul Hänsch <paul@plutz.net>
Tue, 30 May 2023 15:12:05 +0000 (17:12 +0200)
committerPaul Hänsch <paul@plutz.net>
Tue, 30 May 2023 15:12:05 +0000 (17:12 +0200)
cgilite/markdown.awk

index 100242cb1ebb9b0e2a706a1025dbc552c51c190b..33c12bdc9a5be4bcccd3e5bf1b504182291b0c36 100755 (executable)
@@ -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 "<a href=\"" URL(href) "\">" HTML(text) "</a>" inline( substr( line, len + 1) );