Home / GitHub Page

PDF printout doesn't wordwrap text

When outputting notes in PDF format, any markdown code blocks are cut off instead of the text wordwrapping.

Any solution/workaround for this?

I’ve noticed this too, but I haven’t figured out a workaround. Codeblocks are horizontally scrollable and the electron plugin to print to pdf does not take this into consideration. Maybe this is an issue that has to be raised with Electron.

I thought i had added a fix for this at some point. The css just needs to be set to wordwrap when printing.

This does even work for code blocks? If yes, it’d either not set or there’s a bug upstream.

Code blocks are in <pre> tags and they don’t wrap by default. For printing I’ve added white-space: pre-wrap; which means it should wrap, so not sure why it doesn’t.

Maybe it gets overridden by the syntax highlighter package???

@laurent how can we debug this further? This is quite an annoyance and makes printing code blocks pretty much impossible.