-
-
Notifications
You must be signed in to change notification settings - Fork 18.2k
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
Bugfix : Added mathjax_ignore
to HTMLFormatter._write_table and changed tests to assert mathjax_ignore
#60043
Conversation
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 - test cases covered
/preview |
@datapythonista - the https://github.com/pandas-dev/pandas/actions/runs/11469095078/job/31915606006 Should I open an issue? |
pandas/io/formats/style_render.py
Outdated
@@ -366,9 +366,11 @@ def _translate( | |||
if not get_option("styler.html.mathjax"): | |||
table_attr = table_attr or "" | |||
if 'class="' in table_attr: | |||
table_attr = table_attr.replace('class="', 'class="tex2jax_ignore ') | |||
table_attr = table_attr.replace( | |||
'class="', 'class="tex2jax_ignore mathjax_ignore"' |
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.
This should be
'class="', 'class="tex2jax_ignore mathjax_ignore '
as we are prepending to an already existing class.
Co-authored-by: Richard Shadrach <[email protected]>
Fixed error in prepending existing class in table_attr
pandas/io/formats/style_render.py
Outdated
else: | ||
table_attr += ' class="tex2jax_ignore"' | ||
table_attr += 'class="tex2jax_ignore mathjax_ignore"' |
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.
There is a reason for this space at the start.
pandas/io/formats/style_render.py
Outdated
else: | ||
table_attr += ' class="tex2jax_ignore"' | ||
table_attr += 'class="tex2jax_ignore mathjax_ignore"' |
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.
table_attr += 'class="tex2jax_ignore mathjax_ignore"' | |
table_attr += ' class="tex2jax_ignore mathjax_ignore"' |
This PR seems to have gone stale, can I take over this issue? Thanks |
@KevsterAmp - sounds good. |
@@ -366,9 +366,11 @@ def _translate( | |||
if not get_option("styler.html.mathjax"): | |||
table_attr = table_attr or "" | |||
if 'class="' in table_attr: | |||
table_attr = table_attr.replace('class="', 'class="tex2jax_ignore ') | |||
table_attr = table_attr.replace( | |||
'class="', ' class="tex2jax_ignore mathjax_ignore ' |
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.
'class="', ' class="tex2jax_ignore mathjax_ignore ' | |
'class="', 'class="tex2jax_ignore mathjax_ignore ' |
@rhshadrach - Do I commit on this branch or I re-open a new PR? Thanks |
Thanks for this PR, but the issue was closed by #60311 |
doc/source/whatsnew/vX.X.X.rst
file if fixing a bug or adding a new feature.Feedback would be appreciated.