Hi all,
I’m using MigraDoc to render formatted text into a PDF, and I’ve encountered an issue with line breaks inside table cells.
In our WPF application, we use MigraDoc to generate PDFs from rich text input. Users often press Shift+Enter to insert a line break (without starting a new paragraph). We’re seeing unexpected behavior in the generated PDF: line breaks added via Shift+Enter seem to be collapsed or ignored — but only when they occur without text directly before them.
Input in the app (typed in a table cell):
Quote:
abc
<Shift+Enter>
def
<Shift+Enter>
<Shift+Enter>
<Shift+Enter>
ghi
Expected output in pdf:
Quote:
abc
def
ghi
Actual output:
Quote:
abc
def
ghi
The three AddLineBreak() calls between def and ghi seem to be collapsed (only one line shown).
It appears that if the paragraph has no text content, MigraDoc silently skips the line break.
Is this the intended behavior in MigraDoc? Is there official documentation or a GitHub issue explaining why line breaks are ignored unless the paragraph already contains content?
Any confirmation or workaround recommendations would be greatly appreciated.
Thanks!