Fix with Try/Except for older versions

This commit is contained in:
Nihesh Rachakonda 2025-05-12 16:38:48 +05:30
parent 96fff1eb47
commit 372ac60441

View File

@ -66,7 +66,10 @@ def render(
if jupyter or (jupyter is None and is_in_jupyter()): if jupyter or (jupyter is None and is_in_jupyter()):
# return HTML rendered by IPython display() # return HTML rendered by IPython display()
# See #4840 for details on span wrapper to disable mathjax # See #4840 for details on span wrapper to disable mathjax
try:
from IPython.display import HTML, display from IPython.display import HTML, display
except ImportError:
from IPython.core.display import HTML, display
return display(HTML('<span class="tex2jax_ignore">{}</span>'.format(html))) return display(HTML('<span class="tex2jax_ignore">{}</span>'.format(html)))
return html return html