From f80c06a44ea004611c6f0e7ec56f1408ac82bdc6 Mon Sep 17 00:00:00 2001 From: Your Name Date: Sat, 12 Jan 2019 22:10:14 +0900 Subject: [PATCH] Relative path ".:" does not work (3rd revised) close #95 --- syntax/archive.php | 7 +++++++ syntax/autoarchive.php | 7 +++++++ syntax/blog.php | 7 +++++++ 3 files changed, 21 insertions(+) diff --git a/syntax/archive.php b/syntax/archive.php index f21da11..787d094 100644 --- a/syntax/archive.php +++ b/syntax/archive.php @@ -53,6 +53,13 @@ function handle($match, $state, $pos, Doku_Handler $handler) { if ($ns == '') $ns = cleanID($this->getConf('namespace')); elseif (($ns == '*') || ($ns == ':')) $ns = ''; elseif ($ns == '.') $ns = getNS($ID); + elseif (preg_match('/^\.:/', $ns)){ + if (getNS($ID)) { + $ns = getNS($ID) . ltrim($ns, "."); + } else { + $ns = ltrim($ns, ".:"); + } + } else $ns = cleanID($ns); // daily archive diff --git a/syntax/autoarchive.php b/syntax/autoarchive.php index 5139fcf..23535da 100644 --- a/syntax/autoarchive.php +++ b/syntax/autoarchive.php @@ -37,6 +37,13 @@ function handle($match, $state, $pos, Doku_Handler $handler) { if ($ns == '') $ns = cleanID($this->getConf('namespace')); elseif (($ns == '*') || ($ns == ':')) $ns = ''; elseif ($ns == '.') $ns = getNS($ID); + elseif (preg_match('/^\.:/', $ns)){ + if (getNS($ID)) { + $ns = getNS($ID) . ltrim($ns, "."); + } else { + $ns = ltrim($ns, ".:"); + } + } else $ns = cleanID($ns); return array($ns, $flags, $refine, $pos); diff --git a/syntax/blog.php b/syntax/blog.php index 4311330..fd532f0 100644 --- a/syntax/blog.php +++ b/syntax/blog.php @@ -49,6 +49,13 @@ function handle($match, $state, $pos, Doku_Handler $handler) { if ($ns == '') $ns = cleanID($this->getConf('namespace')); elseif (($ns == '*') || ($ns == ':')) $ns = ''; elseif ($ns == '.') $ns = getNS($ID); + elseif (preg_match('/^\.:/', $ns)){ + if (getNS($ID)) { + $ns = getNS($ID) . ltrim($ns, "."); + } else { + $ns = ltrim($ns, ".:"); + } + } else $ns = cleanID($ns); return array($ns, $num, $flags, $refine);