Skip to content

Commit

Permalink
fix: Always use id of main page
Browse files Browse the repository at this point in the history
  • Loading branch information
micgro42 committed Apr 11, 2017
1 parent 9856122 commit fec857f
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions syntax.php
Original file line number Diff line number Diff line change
Expand Up @@ -121,12 +121,13 @@ public function render($mode, Doku_Renderer $renderer, $data) {
* @author Michael Braun <[email protected]>
*/
protected function _parseNS($ns) {
global $ID;
global $INFO;
$id = $INFO['id'];
if(strpos($ns, '@PAGE@') !== false) {
return cleanID(str_replace('@PAGE@', $ID, $ns));
return cleanID(str_replace('@PAGE@', $id, $ns));
}
if($ns == "@NS@") return getNS($ID);
$ns = preg_replace("/^\.(:|$)/", dirname(str_replace(':', '/', $ID)) . "$1", $ns);
if($ns == "@NS@") return getNS($id);
$ns = preg_replace("/^\.(:|$)/", dirname(str_replace(':', '/', $id)) . "$1", $ns);
$ns = str_replace("/", ":", $ns);
$ns = cleanID($ns);
return $ns;
Expand Down

0 comments on commit fec857f

Please sign in to comment.