Skip to content

Commit 05e773d

Browse files
committed
Fix dw2pdf multipage struct output
When the dw2pdf plugin is used to export multiple pages in a single document, all the pages are rendered in a single instance of syntax_plugin_struct_output. We want to allow this usecase and only skip repeated calls for non-dw2pdf renderings. Signed-off-by: Frieder Schrempf <dev@fris.de>
1 parent d9b413c commit 05e773d

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

syntax/output.php

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,9 +98,19 @@ public function render($format, Doku_Renderer $renderer, $data)
9898
return true;
9999
}
100100
}
101+
101102
if ($ID != $INFO['id']) return true;
102103
if (!$INFO['exists']) return true;
103-
if ($this->hasBeenRendered) return true;
104+
105+
/*
106+
* When the dw2pdf plugin is used to export multiple pages in a
107+
* single document, all the pages are rendered in a single instance
108+
* of syntax_plugin_struct_output. We want to allow this usecase and
109+
* only skip repeated calls for non-dw2pdf renderings.
110+
*/
111+
if (!is_a($renderer, 'renderer_plugin_dw2pdf') && $this->hasBeenRendered)
112+
return true;
113+
104114
if (!preg_match(self::WHITELIST_ACTIONS, act_clean($ACT))) return true;
105115

106116
// do not render the output twice on the same page, e.g. when another page has been included

0 commit comments

Comments
 (0)