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

Highlight.js is not compatible with Hugo. #12

Closed
izdwuut opened this issue Sep 27, 2018 · 0 comments
Closed

Highlight.js is not compatible with Hugo. #12

izdwuut opened this issue Sep 27, 2018 · 0 comments

Comments

@izdwuut
Copy link
Contributor

izdwuut commented Sep 27, 2018

Hi there!

I have noticed that while highlight.js runs on the site, a code snippet with line numbers (linenos parameter set to table) enabled gets displayed wrong. The library doesn't come with line numbering feature thus I think that it's not fully compatible with Hugo and it shouldn't be used with it. Related themes simply don't come with required CSS rules.

Here's a related PR with my suggested changes.

Steps to reproduce:

  1. Create a Hugo site using hugo-paper theme.
  2. Write the following post in markdown:
{{< highlight python "linenos=table" >}}
var = 2
if var is 2:
    print("Hello world!")
{{< / highlight >}}
  1. Code snippets with line numbers enabled should display incorrectly. It also messes with the shortcode without params:

preview

Tested browsers:

  • Firefox Developer Edition 63.0b9 (64-bit)
  • Chrome Version 69.0.3497.100 (Official Build) (64-bit)
  • Microsoft Edge 40.15063.674.0
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