-
Notifications
You must be signed in to change notification settings - Fork 2.5k
Better parsing of color styles in CodeMobject #4454
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
Better parsing of color styles in CodeMobject #4454
Conversation
for more information, see https://pre-commit.ci
for more information, see https://pre-commit.ci
|
I have now looked a bit closer to your solution. It works in my tests, but I think that there is an even better solution for the issue. My test case is the following code If I run this code on the main branch (4dd2937) I get the following error for the style I expect that this is the original issue that you tried to solve. With the current version of this PR, everything seems to work ok. These values are then interpreted by This is what the code suggested by maejam does. Now the extracted color codes are as follows: |
Code suggested by maejam
|
@henrikmidtiby I am okay with |
|
@SirJamesClarkMaxwell I think it should be your PR, as you identified the issue and the first step towards a solution. |
henrikmidtiby
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
It adds a sanity check in
CodeMobjectconstructor during the coloring of patrs the text that style has "color: " string, if not it sets color to None by default. This PR is inspired by the post on the help-formu https://discord.com/channels/581738731934056449/1431310500125212753Overview: What does this pull request change?
Motivation and Explanation: Why and how do your changes improve the library?
Links to added or changed documentation pages
Further Information and Comments
Reviewer Checklist