From 043a1d47776399a9cd7642ce5cc33602a79ea21b Mon Sep 17 00:00:00 2001 From: Isaac Flath Date: Tue, 12 Nov 2024 00:22:16 -0500 Subject: [PATCH] change markupsafe to use stdlib html.escape --- fastcore/ansi.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/fastcore/ansi.py b/fastcore/ansi.py index 216756d5..c921ee35 100644 --- a/fastcore/ansi.py +++ b/fastcore/ansi.py @@ -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"] @@ -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)