Closed gertvdijk closed 2 years ago
Can you please add a test for multiple highlighted blocks?
@mitya57 Added them to the now amended commit. π
CI error appears unrelated to my change. π
43 files checked. ERROR: 5 files with dead links found!
The reason why we pop
the setting is because we also pass the rest of the config items on to Pygments (see the very next line). As each of Pygmants' lexers/formatters have a different set of options they accept, we just pass all unknown keywords on. However, there is no need to pass the style on as we have already defined that. The only reason we don't get an error is because Pygments just ignores any unknown keywords passed to its lexers and formatters. Still, it would be best to not pass it on to avoid any weird conflicts in the future.
Perhaps we should be making a copy of the config for each code block and then we can pop the setting off of the copy.
As an aside, we have the pygments_style
setting for historical reasons (it existed before we accepted all Pygments options). If we were starting fresh today we would not define a special option for it and users could just use style
which would get passed it on with the rest of the Pygments' keyword options. Actually, a user could avoid this bug by using style
now (without this fix). That said, we should still fix the bug. Although, we might want to deprecate the pygments_style
option as it is duplicative and unnecessary.
CI error appears unrelated to my change. π
43 files checked. ERROR: 5 files with dead links found!
Yes, I see that. I have opened a separate issue for that in #1243. You can ignore that failure here.
@waylan Thanks for the explanation! π It took a bit longer to get back to this, but I've pushed an amendment.
This fixes a bug where any subsequent highlighted block with codehilite would result in the omission of the style setting, falling back to default.
Fixes #1240