Skip to content

Commit

Permalink
change markupsafe to use stdlib html.escape
Browse files Browse the repository at this point in the history
  • Loading branch information
Isaac-Flath committed Nov 12, 2024
1 parent dc3e596 commit 043a1d4
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions fastcore/ansi.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@
# Copyright (c) IPython Development Team.
# Modifications by Jeremy Howard.

import re, markupsafe
import re
from html import escape

__all__ = ["strip_ansi", "ansi2html", "ansi2latex"]

Expand All @@ -19,7 +20,7 @@ def strip_ansi(source):

def ansi2html(text):
"Convert ANSI colors to HTML colors."
text = markupsafe.escape(text)
text = escape(text)
return _ansi2anything(text, _htmlconverter)


Expand Down

0 comments on commit 043a1d4

Please sign in to comment.