Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix dw2pdf multipage struct output #574

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 11 additions & 1 deletion syntax/output.php
Original file line number Diff line number Diff line change
Expand Up @@ -98,9 +98,19 @@ public function render($format, Doku_Renderer $renderer, $data)
return true;
}
}

if ($ID != $INFO['id']) return true;
if (!$INFO['exists']) return true;
if ($this->hasBeenRendered) return true;

/*
* 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.
*/
if (!is_a($renderer, 'renderer_plugin_dw2pdf') && $this->hasBeenRendered)
return true;

if (!preg_match(self::WHITELIST_ACTIONS, act_clean($ACT))) return true;

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