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

Pandoc highlight CSS renders weirdly #1000

Closed
roxspring opened this issue Nov 29, 2019 · 3 comments
Closed

Pandoc highlight CSS renders weirdly #1000

roxspring opened this issue Nov 29, 2019 · 3 comments
Labels
bug Existing features not working as expected
Milestone

Comments

@roxspring
Copy link

roxspring commented Nov 29, 2019

Given this markdown:

function helloWorld() {
  return 'Hello, World!';
}

Pandoc (2.7.3) produces this html which safari renders reasonably as:

Screenshot 2019-11-29 at 19 47 19

But when processed through WeasyPrint (48) some weird wrapping occurs:

png

Has anybody else seen this?

Is there something odd in the pandoc-supplied CSS and tripping up WeasyPrint?

@liZe
Copy link
Member

liZe commented Dec 15, 2019

Small sample:

<style type="text/css">
  code {
    white-space: pre-wrap;
  }
  code > span {
    display: inline-block;
    text-indent: -5em;
  }
</style>
<code><span><span>function</span> <span>helloWorld</span>() <span>{</span></span>
<span>  <span>return</span> <span>&#39;Hello, World!&#39;</span><span>;</span></span>
<span><span>}</span></span></code>

@liZe liZe added the bug Existing features not working as expected label Dec 15, 2019
@runxel
Copy link

runxel commented Mar 3, 2020

It's even worse for me... :/

wtf

@liZe liZe added this to the 52 milestone Mar 16, 2020
@liZe liZe closed this as completed in aeb00c5 Mar 16, 2020
@liZe
Copy link
Member

liZe commented Mar 16, 2020

Thanks for your report.

Is there something odd in the pandoc-supplied CSS and tripping up WeasyPrint?

text-indent was applied twice on inline blocks. That’s often invisible for positive values when text is displayed on a transparent background (normal case), but it’s really bad for negative values.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Existing features not working as expected
Projects
None yet
Development

No branches or pull requests

3 participants