Skip to content

Commit d498759

Browse files
committed
bug fix and added mathjax_ignore to tests
1 parent 2a10e04 commit d498759

File tree

3 files changed

+5
-4
lines changed

3 files changed

+5
-4
lines changed

pandas/io/formats/html.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -241,6 +241,7 @@ def _write_table(self, indent: int = 0) -> None:
241241
use_mathjax = get_option("display.html.use_mathjax")
242242
if not use_mathjax:
243243
_classes.append("tex2jax_ignore")
244+
_classes.append("mathjax_ignore")
244245
if self.classes is not None:
245246
if isinstance(self.classes, str):
246247
self.classes = self.classes.split()

pandas/tests/io/formats/style/test_style.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -487,10 +487,10 @@ def test_repr_html_ok(self, styler):
487487

488488
def test_repr_html_mathjax(self, styler):
489489
# gh-19824 / 41395
490-
assert "tex2jax_ignore" not in styler._repr_html_()
490+
assert "tex2jax_ignore" and "mathjax_ignore" not in styler._repr_html_()
491491

492492
with option_context("styler.html.mathjax", False):
493-
assert "tex2jax_ignore" in styler._repr_html_()
493+
assert "tex2jax_ignore" and "mathjax_ignore" in styler._repr_html_()
494494

495495
def test_update_ctx(self, styler):
496496
styler._update_ctx(DataFrame({"A": ["color: red", "color: blue"]}))

pandas/tests/io/formats/test_to_html.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -933,10 +933,10 @@ def test_repr_html(self, float_frame):
933933

934934
def test_repr_html_mathjax(self):
935935
df = DataFrame([[1, 2], [3, 4]])
936-
assert "tex2jax_ignore" not in df._repr_html_()
936+
assert "tex2jax_ignore" and "mathjax_ignore" not in df._repr_html_()
937937

938938
with option_context("display.html.use_mathjax", False):
939-
assert "tex2jax_ignore" in df._repr_html_()
939+
assert "tex2jax_ignore" and "mathjax_ignore" in df._repr_html_()
940940

941941
def test_repr_html_wide(self):
942942
max_cols = 20

0 commit comments

Comments
 (0)