- Sponsor
-
Notifications
You must be signed in to change notification settings - Fork 3.7k
Recent Block Code Highlighting Style Issues #1451
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
Comments
Thanks for reporting those cases. There was a lot of hacking for making code blocks to work in all possible circumstances (especially due to the inconsistencies with |
Should be fixed in |
... we definitely need to set up some layout testing, but screenshot testing is a real pain. I'm working on a solution as part of a side-project and will use Material as a first test case. Changing CSS with confidence is a really hard problem. |
Thanks for looking into to this, and I totally understand. When the new release dropped, I ran it through its paces because I kind of expected something to slip by. Verifying complex CSS with so many little corner cases is kind of a pain. I'll verify master and get back to you. |
Looks great 👍 . I can finally kick the codehilite class too! |
Perfect, thanks for your help! Released as part of 4.6.2. |
In c177506 , you removed the padding for Reintroducing the padding fixes it for me without any noticeable side effects. // Actual content
pre {
padding: px2rem(10.5px) px2rem(16px);
margin: 0;
border-radius: 0
} |
The anomaly you're describing is most likely related to stale dependencies. The |
Oh yes, you're right. Pygments was out of date and not updated when I did |
Anyway, if Material doesn’t render properly anymore without the additional Sent with GitHawk |
Yeah, agree that requiring the latest pygments is probably ideal. Pymdown-extensions doesn't force a requirement for pygments as it is optional (some people prefer JS highlighters), but since material does rely on it, it probably should update the requirements. |
As with the problems we had with Markdown and MkDocs, won't |
It was more a requirement order thing that got us. If the only package requiring Pygments is material, and it doesn't meet the requirement, it should update. Pip's dependency management sucks, but they do have plans to make it better. I don't think You could do >=2.6, but the minimum requirement is >=2.4 as that is the version that Pygments added the option to wrap code with pre and code. |
Thanks for the explanation. I was skimming through their changlog but didn't see anything related to the |
Upgraded Pygments in 8c44604 |
It's some new wrap_code option or something like that. Python Markdown was just forcing it to always be enabled, but Pygments doesn't force it by default. Pymdown-extensions wanted to match Python Markdown to at least have a uniform expectation (with a legacy option to give people time to transition if desired). I like the direction, but it hasn't gone without hiccups 🤷♂️. |
Waylan mentions v2.4 in the release notes for markdown 3.2. |
I checked that...
Description
Small highlight issues when dealing with code blocks in tabbed interfaces and in admonitions.
I suspect part of the problem has to do with some of the mobile logic being removed in the last bugfix.
non table code blocks have padding below them when they are the only element in a
tabbed interface. This is not an issue with the tabbed code blocks with line numbers.
When in mobile interface, the code block spills out of the tabbed interface and extends to the width of the admonition block.
Below we see both issues in the first code example. There seems to be no issues in the tabled version.
Expected behavior
I'd expect the code blocks to extend to the full length of the tabbed interface like they use to.
In mobile interfaces, code blocks would extend properly to the width of the tabbed interface.
Actual behavior
The opposite of expected. See picture above.
Steps to reproduce the bug
View a single code block in a tabbed interface for first issue.
View a code block in a tabbed interface within an admonition for the second issue.
Package versions
Project configuration
System information
The text was updated successfully, but these errors were encountered: