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

Odd line width/wrapping in PDF code blocks #1234

Closed
mtkennerly opened this issue Oct 13, 2020 · 4 comments
Closed

Odd line width/wrapping in PDF code blocks #1234

mtkennerly opened this issue Oct 13, 2020 · 4 comments

Comments

@mtkennerly
Copy link

Hello! Apologies if this is documented somewhere, but I couldn't find an answer when I did some searching.

I'm using Pandoc to convert Markdown to PDF, with WeasyPrint as the --pdf-engine. Everything looks good, except for the line width and wrapping in code blocks. Pandoc's intermediate HTML file looks okay, which is why I think this is something on the WeasyPrint side.

I've created a repository to show what I'm doing:

Here are the HTML and PDF files generated by the invocations in the GitHub workflow:

samples.zip

How the HTML looks (what I want)

image

How the PDF looks (not what I want):

image

The PDF has a lot of unnecessary line wrapping, far before the edge of the code block. I would only want lines to wrap if they extend to the far edge of the code block.

I've also experimented with specifying some extra CSS, but it didn't seem to help, and I'm not sure why the default CSS would look okay in the HTML version but not in the PDF version anyway.

@liZe
Copy link
Member

liZe commented Oct 13, 2020

Hi!

It’s fixed in the current master branch. I’m trying to find the related issue that’s already been closed.

@liZe
Copy link
Member

liZe commented Oct 13, 2020

I’m trying to find the related issue that’s already been closed.

It’s a duplicate of #1000.

@liZe liZe closed this as completed Oct 13, 2020
@mtkennerly
Copy link
Author

@liZe Thanks, using the latest code from master works much better 👍 I'm still seeing something a little odd with how very long lines wrap, though. (I can make a separate ticket if you'd like, but maybe it's already covered by another one.)

samples2.zip

HTML:

image

PDF:

image

The PDF does wrap it, but each line is cut off prematurely, and there are some extra blank lines after the last wrapped line.

@liZe
Copy link
Member

liZe commented Oct 13, 2020

I'm still seeing something a little odd with how very long lines wrap, though.

Oh, that’s odd, for sure 😒.

(I can make a separate ticket if you'd like, but maybe it's already covered by another one.)

I’d love that!

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

No branches or pull requests

2 participants