Skip to content

Preserve line breaks in PDF output when XBR is enabled - #565

Open
bvdbos wants to merge 1 commit into
splitbrain:masterfrom
bvdbos:master
Open

Preserve line breaks in PDF output when XBR is enabled#565
bvdbos wants to merge 1 commit into
splitbrain:masterfrom
bvdbos:master

Conversation

@bvdbos

@bvdbos bvdbos commented Sep 8, 2026

Copy link
Copy Markdown

Summary

This adds support for the optional XBR renderer plugin.

When XBR is installed and enabled, source line breaks are preserved in
PDF output as well. Without XBR, dw2pdf keeps its existing behaviour.

Text escaping and line-break rendering are delegated to the parent
XHTML renderer. This avoids post-processing the completed HTML with
regular expressions.

Testing

Tested with:

  • consecutive single line breaks;
  • a new paragraph separated by an empty line;
  • HTML-like text to verify escaping;
  • XBR installed and enabled.

The resulting PDF matches the XHTML output and displays HTML-like input
as ordinary text.

Fixes #361
Fixes #507

@bvdbos

bvdbos commented Sep 8, 2026

Copy link
Copy Markdown
Author

and to be honest : with help of AI so the earlier uglier hack mentioned in #361 and #507 is not needed... Tested this on my local DW-install...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Linebreaks are not respected xbr render plugin line breaks

1 participant