From 65e722d78a62ba20092f0fdbde59569a6f16fac5 Mon Sep 17 00:00:00 2001 From: ghost Date: Thu, 1 Feb 2024 13:21:59 +0200 Subject: [PATCH] add IPv6 links support --- src/Dokuwiki/Reader.php | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/Dokuwiki/Reader.php b/src/Dokuwiki/Reader.php index 4906a7f..db345fa 100644 --- a/src/Dokuwiki/Reader.php +++ b/src/Dokuwiki/Reader.php @@ -32,6 +32,9 @@ class Reader // Links + /// 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]]', @@ -64,6 +67,10 @@ class Reader '/\[\[(https?:)([^\|]+)\|([^\]]+)\]\]/i' => '$3 ( $1$2 )', '/\[\[(https?:)([^\]]+)\]\]/i' => '$1$2', // @TODO + /// Apply macros + '/~IPv6:open~/' => '[', + '/~IPv6:close~/' => ']', + // List '/^[\s]?-/' => '* ', '/^[\s]+\*/' => '*',