Skip to content

Commit f48f587

Browse files
author
David Hall
committed
Revert "ENH: Add Styler.disable_mathjax() method (pandas-dev#19824)."
This reverts commit 3df97e3.
1 parent 3df97e3 commit f48f587

File tree

2 files changed

+4
-30
lines changed

2 files changed

+4
-30
lines changed

pandas/io/formats/style.py

Lines changed: 2 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -63,8 +63,6 @@ class Styler(object):
6363
a unique identifier to avoid CSS collisons; generated automatically
6464
caption: str, default None
6565
caption to attach to the table
66-
disabled_mathjax: bool, default False
67-
prevent MathJax from processing table contents
6866
6967
Attributes
7068
----------
@@ -113,7 +111,7 @@ class Styler(object):
113111
template = env.get_template("html.tpl")
114112

115113
def __init__(self, data, precision=None, table_styles=None, uuid=None,
116-
caption=None, disabled_mathjax=False, table_attributes=None):
114+
caption=None, table_attributes=None):
117115
self.ctx = defaultdict(list)
118116
self._todo = []
119117

@@ -131,7 +129,6 @@ def __init__(self, data, precision=None, table_styles=None, uuid=None,
131129
self.uuid = uuid
132130
self.table_styles = table_styles
133131
self.caption = caption
134-
self.disabled_mathjax = disabled_mathjax
135132
if precision is None:
136133
precision = get_option('display.precision')
137134
self.precision = precision
@@ -184,7 +181,6 @@ def _translate(self):
184181
"""
185182
table_styles = self.table_styles or []
186183
caption = self.caption
187-
disabled_mathjax = self.disabled_mathjax
188184
ctx = self.ctx
189185
precision = self.precision
190186
hidden_index = self.hidden_index
@@ -331,8 +327,7 @@ def format_attr(pair):
331327

332328
return dict(head=head, cellstyle=cellstyle, body=body, uuid=uuid,
333329
precision=precision, table_styles=table_styles,
334-
caption=caption, disabled_mathjax=disabled_mathjax,
335-
table_attributes=self.table_attributes)
330+
caption=caption, table_attributes=self.table_attributes)
336331

337332
def format(self, formatter, subset=None):
338333
"""
@@ -436,7 +431,6 @@ def render(self, **kwargs):
436431
* precision
437432
* table_styles
438433
* caption
439-
* disabled_mathjax
440434
* table_attributes
441435
"""
442436
self._compute()
@@ -471,7 +465,6 @@ def _update_ctx(self, attrs):
471465
def _copy(self, deepcopy=False):
472466
styler = Styler(self.data, precision=self.precision,
473467
caption=self.caption, uuid=self.uuid,
474-
disabled_mathjax=self.disabled_mathjax,
475468
table_styles=self.table_styles)
476469
if deepcopy:
477470
styler.ctx = copy.deepcopy(self.ctx)
@@ -801,17 +794,6 @@ def set_table_styles(self, table_styles):
801794
self.table_styles = table_styles
802795
return self
803796

804-
def disable_mathjax(self):
805-
"""
806-
Prevent MathJax from processing table contents.
807-
808-
Returns
809-
-------
810-
self : Styler
811-
"""
812-
self.disabled_mathjax = True
813-
return self
814-
815797
def hide_index(self):
816798
"""
817799
Hide any indices from rendering.

pandas/io/formats/templates/html.tpl

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -23,11 +23,7 @@
2323
{%- endblock cellstyle %}
2424
</style>
2525
{%- endblock style %}
26-
{%- block before_table %}
27-
{%- if disabled_mathjax -%}
28-
<div class="tex2jax_ignore">
29-
{%- endif -%}
30-
{% endblock before_table %}
26+
{%- block before_table %}{% endblock before_table %}
3127
{%- block table %}
3228
<table id="T_{{uuid}}" {% if table_attributes %}{{ table_attributes }}{% endif %}>
3329
{%- block caption %}
@@ -71,8 +67,4 @@
7167
{%- endblock tbody %}
7268
</table>
7369
{%- endblock table %}
74-
{%- block after_table %}
75-
{%- if disabled_mathjax -%}
76-
</div>
77-
{%- endif -%}
78-
{% endblock after_table %}
70+
{%- block after_table %}{% endblock after_table %}

0 commit comments

Comments
 (0)