From 03d2e88efc7b2046a404679a36a8a65d6faae98c Mon Sep 17 00:00:00 2001 From: Oleg Broytman Date: Thu, 16 Nov 2023 08:26:52 +0300 Subject: [PATCH] Fix(Py3): Fix `unescape` --- bkmk_objects.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/bkmk_objects.py b/bkmk_objects.py index b9dabff..7415670 100644 --- a/bkmk_objects.py +++ b/bkmk_objects.py @@ -228,8 +228,13 @@ def quote_title(title): def unquote_title(title): if BKMK_FORMAT == "MOZILLA": - from HTMLParser import HTMLParser - title = HTMLParser().unescape( + try: + from HTMLParser import HTMLParser + except ImportError: + from html import unescape + else: + unescape = HTMLParser().unescape + title = unescape( title.replace("&", '&')) title = title.replace("'", "'") return title -- 2.39.5