From 4d9852cbccde75f805185607bfe42c9004e015ab Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=81=8D=E5=85=AE=E6=83=9A=E5=85=AE?= <101191390+HIllya51@users.noreply.github.com> Date: Thu, 20 Jun 2024 00:25:11 +0800 Subject: [PATCH] fix --- LunaTranslator/LunaTranslator/rendertext/webview.py | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/LunaTranslator/LunaTranslator/rendertext/webview.py b/LunaTranslator/LunaTranslator/rendertext/webview.py index 22f96f78..f6082fad 100644 --- a/LunaTranslator/LunaTranslator/rendertext/webview.py +++ b/LunaTranslator/LunaTranslator/rendertext/webview.py @@ -133,7 +133,9 @@ class TextBrowser(QWidget, dataget): def gen_html(self, *args): currenttype = globalconfig["rendertext_using_internal"]["webview"] try: - __ = importlib.import_module(f"rendertext.internal.webview.{currenttype}") + __ = importlib.import_module( + f"rendertext.internal.webview.{currenttype}" + ).TextLine except: from traceback import print_exc @@ -141,10 +143,10 @@ class TextBrowser(QWidget, dataget): globalconfig["rendertext_using_internal"]["webview"] = currenttype = list( globalconfig["rendertext"]["webview"].keys() )[0] - __ = importlib.import_module(f"rendertext.internal.webview.{currenttype}") - return __.TextLine(currenttype, self.webivewwidget.webview, self).gen_html__( - *args - ) + __ = importlib.import_module( + f"rendertext.internal.webview.{currenttype}" + ).TextLine + return __(currenttype, self.webivewwidget.webview, self).gen_html__(*args) def _webview_append(self, _id, origin, atcenter, text, tag, flags, color): text = text.replace("\n", "
").replace("\\", "\\\\")