Skip to content

Commit 7bbd493

Browse files
committed
Remove ansi2html.
1 parent 7527383 commit 7bbd493

File tree

2 files changed

+1
-18
lines changed

2 files changed

+1
-18
lines changed

dash/_jupyter.py

Lines changed: 1 addition & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
import os
66
import queue
77
import uuid
8-
import re
98
import sys
109
import threading
1110
import time
@@ -22,7 +21,6 @@
2221
from IPython.core.display import HTML
2322
from IPython.core.ultratb import FormattedTB
2423
from retrying import retry
25-
from ansi2html import Ansi2HTMLConverter
2624
from ipykernel.comm import Comm
2725
import nest_asyncio
2826

@@ -471,21 +469,7 @@ def _wrap_errors(error):
471469
if self.inline_exceptions:
472470
print(ansi_stacktrace)
473471

474-
# Use ansi2html to convert the colored ANSI string to HTML
475-
conv = Ansi2HTMLConverter(scheme="ansi2html", dark_bg=False)
476-
html_str = conv.convert(ansi_stacktrace)
477-
478-
# Set width to fit 75-character wide stack trace and font to a size the
479-
# won't require a horizontal scroll bar
480-
html_str = html_str.replace(
481-
"<html>", '<html style="width: 75ch; font-size: 0.86em">'
482-
)
483-
484-
# Remove explicit background color so Dash dev-tools can set background
485-
# color
486-
html_str = re.sub("background-color:[^;]+;", "", html_str)
487-
488-
return html_str, 500
472+
return ansi_stacktrace, 500
489473

490474
@property
491475
def active(self):

requires-install.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,5 @@ contextvars==2.4;python_version<"3.7"
1010
typing_extensions>=4.1.1
1111
requests
1212
retrying
13-
ansi2html
1413
nest-asyncio
1514
setuptools

0 commit comments

Comments
 (0)