Skip to content

Commit

Permalink
Relative path ".:" does not work (3rd revised) close dokufreaks#95
Browse files Browse the repository at this point in the history
  • Loading branch information
Your Name committed Jan 12, 2019
1 parent 52d0148 commit f80c06a
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 0 deletions.
7 changes: 7 additions & 0 deletions syntax/archive.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
7 changes: 7 additions & 0 deletions syntax/autoarchive.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
7 changes: 7 additions & 0 deletions syntax/blog.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit f80c06a

Please sign in to comment.