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 highlighting colours the whole line in --md-code-hl-color #6017
Comments
Hi, thanks for the report and the reproduction. I have run it and see the same result as you do. However, when I compiled the reproduction earlier using my mkdocs install the issue did not appear. I was using the insiders version, though. Let me see if I can figure out where this comes from and get back to you. (I just started to contribute to material-mkdocs, so may take a little longer than squidfunk would, please bear with me.) Cheers, Alex |
Quick update: I found no relevant differences in what |
@alexvoss, you are welcome to dig into pymdownx plugins if you like, but there have been no significant changes to the output format for a very long time. Line highlights are controlled by Pygments. We simply feed in the specified lines. I am more than happy to fix anything if you were somehow able to point to pymdownx, but I am very skeptical. |
@facelessuser thanks, that is good to know. I will have a look - mainly to learn about the interactions between mkdocs, mkdocs-material, plugins and JS libraries / CSS used. I am a new contributor, so this is a useful exercise, methinks. |
Ok, I think I understand what is going on. There is a difference in |
Alright, pull request #6024 should fix this unwanted divergence between public and insider. |
Wow, that was fast! Thanks for your efforts, let's wait for a merge ^^ |
I managed to create a pull request but not actually request a review from squidfunk, which is now fixed. |
fix: unwanted divergence public vs. insider #6017
Released as part of 9.3.2. |
Hello, sorry to barge in here but could you take a look at the above linked ticket from backstage and tell me if this highlighting change is intentional, or do I have some sort of incompatibility? I have a large set of mkdocs documentation that was using these full line highlighting and they have now suddenly switched to only highlighting the side of the line with no background color once upgrading |
As highlighting works without problems on our side, the problem can be anywhere, as I understand that Backstage does heavy customization of Material for MkDocs. Thus, I recommend stripping down customizations on your side one-by-one to isolate the cause of this. In any case, it's a downstream customization. You may ask on our discussion board for help, but we don't consider this to be an issue on our side, as everything is working as expected. |
Context
I'm working on a freshly setup instance of Material for MkDocs and code highlighting seems to be off, compared to the results shown in the docs.
Bug description
Compared to the example from the docs, the result rendered on my end is
a) yellowish instead of blue
b) renders the whole line in
--md-code-hl-color
instead of just the left border and the remainder in--md-code-hl-color
according to my dev tools:My related configuration looks like this, I went by the book, i.e. the docs, if not mistaken:
Related links
I took a good look at the
pygments
/Highlight
configuration:as well as the docs regarding how to do highlighting and how to theme it:
I managed to get the bluish highlight working this way, but it still covered the whole line in the darker variant and omitted the
--light
variant altogether.Reproduction
9.3.1-highlight-wrong-css.zip
Steps to reproduce
mkdocs serve
ormkdocs build
Browser
No response
Before submitting
The text was updated successfully, but these errors were encountered: