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

Code blocks look ugly with line numbers enabled for Kramdown #2323

Closed
iBug opened this issue Nov 17, 2019 · 3 comments
Closed

Code blocks look ugly with line numbers enabled for Kramdown #2323

iBug opened this issue Nov 17, 2019 · 3 comments

Comments

@iBug
Copy link
Collaborator

iBug commented Nov 17, 2019

Environment

  • Minimal Mistakes version: 4.17.2
  • Ruby gem or remote theme version: 4.17.2
  • Jekyll version: 3.8.6
  • Git repository URL: N/A
  • GitHub Pages hosted (if yes provide URL to site): https://risc-v.ibugone.com/toolchain/c/ (Example page with reproducible behavior, will revert after issue solved or a few months in the future)

Steps to reproduce the behavior

Create a code block like this:

```
code
```

Set this key in _config.yml:

kramdown:
  syntax_highlighter: rouge
  syntax_highlighter_opts:
    block:
      line_numbers: true

And render the site

It ends up looking like this:

image

I tried to fix this on my own but failed.

Potentially useful resources:

@mmistakes
Copy link
Owner

Not sure how to handle this one. The HTML Jekyll produces for syntax highlighting with line numbers enabled via Kramdown is different from that of what the highlight tag outputs.

Look at this sample post and you can see line numbering via the highlight looks good.

https://mmistakes.github.io/minimal-mistakes/markup-syntax-highlighting/

If I alter the CSS for Kramdown flag output it breaks the highlight tag styling and vice versa. There’s an issue on Jekyll/Jekyll proposing to harmonize the two, but I don’t think there’s been movement on it for some time.

@mmistakes
Copy link
Owner

This was an issue awhile back that I believe I fixed. Not able to check the HTML now but perhaps Kramdown enabled line numbering changed their markup again.

#1467

@iBug
Copy link
Collaborator Author

iBug commented Nov 17, 2019

OK thanks I'll use Jekyll {% highlight %} tag for now. It at least offers per-block line number control.

@iBug iBug closed this as completed Nov 17, 2019
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