Skip to content

Commit

Permalink
Merge pull request #648 from fastai/stdlib-escape
Browse files Browse the repository at this point in the history
change markupsafe to use stdlib html.escape
  • Loading branch information
Isaac-Flath authored Nov 12, 2024
2 parents dc3e596 + 043a1d4 commit 93dbbf0
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 93dbbf0

Please sign in to comment.