diff --git a/qt/aqt/webview.py b/qt/aqt/webview.py index 0196df875..1e1da0ede 100644 --- a/qt/aqt/webview.py +++ b/qt/aqt/webview.py @@ -15,6 +15,8 @@ from aqt.qt import * from aqt.theme import theme_manager from aqt.utils import openLink +serverbaseurl = re.compile(r"^.+:\/\/[^\/]+") + # Page for debug messages ########################################################################## @@ -74,7 +76,7 @@ class AnkiWebPage(QWebEnginePage): # type: ignore if srcID.startswith("data"): srcID = "" else: - srcID = re.sub(r"(?mi).+://[^/]+", "", srcID[:80]) + srcID = serverbaseurl.sub("", srcID[:80], 1) if level == QWebEnginePage.InfoMessageLevel: level = "info" elif level == QWebEnginePage.WarningMessageLevel: