Skip to content

Commit

Permalink
Improves exist data by adding it later in render, see #61
Browse files Browse the repository at this point in the history
  • Loading branch information
Klap-in committed Aug 20, 2022
1 parent ca54d3d commit 27b2e0a
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions syntax.php
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,6 @@ public function handle($match, $state, $pos, Doku_Handler $handler)
'title' => trim($title),
'titleimage' => trim($image),
'description' => trim($description), // Holds the added parameter for own descriptions
'exists' => $exists,
);

// text title (if any)
Expand All @@ -82,7 +81,6 @@ public function handle($match, $state, $pos, Doku_Handler $handler)
'section' => cleanID($section),
'title' => trim($title),
'description' => trim($description), // Holds the added parameter for own descriptions
'exists' => $exists,
);
}
}
Expand All @@ -101,6 +99,10 @@ public function render($format, Doku_Renderer $renderer, $data)
{
list($flags, $pages) = $data;

foreach ($pages as $i => $page) {
$pages[$i]['exists'] = page_exists($page['id']);
}

// for XHTML output
if ($format == 'xhtml') {
/** @var helper_plugin_pagelist $pagelist */
Expand Down

0 comments on commit 27b2e0a

Please sign in to comment.