wcoder / highlightjs-line-numbers.js

Line numbering plugin for Highlight.js

Home Page:https://wcoder.github.io/highlightjs-line-numbers.js/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

highlightjs-line-numbers changes code font

wermos opened this issue · comments

Describe the bug
The highlightjs-line-numbers plugin changed the code font on my Jekyll blog (repo link) when I added it as a plugin, following the instructions given in the usage portion of the README.

Expected behavior
The code font should not change.

Screenshots
This is what code snippets currently look like:
image

This is what they're supposed to look like, but with line numbers:
image

Desktop:

  • OS: Windows
  • Browser: Edge
  • Version: 105.0.1343.33

However, I don't think this is a browser-specific issue.

Additional context
In the main branch, one can see the code I added to _include/scripts.html to get highlight.js working.

In the custom-liquid-tag branch, the only lines I changed were these, in accordance with the README, but the code font inexplicably changed.

Thanks for the report!

I investigated the issue. See the result:

Line-number plugin uses table under the hood.

Table styles on your site (main.css) override and break font, try to rework:
Screen Shot 2022-09-16 at 12 37 45 AM

Wow, thank you so much! I had been trying to solve this issue for the past 3 days, and now I finally know what was happening. I'll close this issue, because this is not an actual bug with the plugin.