From 676851ce55ff005145b23ab7aaaab87b5699d11d Mon Sep 17 00:00:00 2001 From: ghost Date: Sun, 4 Feb 2024 18:18:22 +0200 Subject: [PATCH] remove extras --- src/Dokuwiki/Reader.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/Dokuwiki/Reader.php b/src/Dokuwiki/Reader.php index a246163..dc8ba86 100644 --- a/src/Dokuwiki/Reader.php +++ b/src/Dokuwiki/Reader.php @@ -42,12 +42,12 @@ class Reader /// Detect IPv6 (used as no idea how to resolve square quotes in rules below) '/\[\[([^\[]+)\[([A-f:0-9]*)\]([^\]]+)\]\]/' => '$1~IPv6:open~$2~IPv6:close~$3', - /// Remove extra spaces - '/\[\[\s*([^\|]+)\s*\|\s*([^\]]+)\s*\]\]/' => '[[$1|$2]]', - '/\[\[\s*([^\]]+)\s*\]\]/' => '[[$1]]', + /// Remove extras + '/\[\[\s*\:?([^\|]+)\s*\|\s*([^\]]+)\s*\]\]/' => '[[$1|$2]]', + '/\[\[\s*\:?([^\]]+)\s*\]\]/' => '[[$1]]', - '/\{\{\s*([^\|]+)\s*\|\s*([^\}]+)\s*\}\}/' => '{{$1|$2}}', - '/\{\{\s*([^\}]+)\s*\}\}/' => '{{$1}}', + '/\{\{\s*\:?([^\|]+)\s*\|\s*([^\}]+)\s*\}\}/' => '{{$1|$2}}', + '/\{\{\s*\:?([^\}]+)\s*\}\}/' => '{{$1}}', /// Wikipedia '/\[\[wp([A-z]{2,})>([^\|]+)\|([^\]]+)\]\]/ui' => '$3 ( https://$1.wikipedia.org/wiki/$2 )',