This commit is contained in:
恍兮惚兮 2024-06-20 00:25:11 +08:00
parent f2bf3bc0d4
commit 4d9852cbcc

View File

@ -133,7 +133,9 @@ class TextBrowser(QWidget, dataget):
def gen_html(self, *args): def gen_html(self, *args):
currenttype = globalconfig["rendertext_using_internal"]["webview"] currenttype = globalconfig["rendertext_using_internal"]["webview"]
try: try:
__ = importlib.import_module(f"rendertext.internal.webview.{currenttype}") __ = importlib.import_module(
f"rendertext.internal.webview.{currenttype}"
).TextLine
except: except:
from traceback import print_exc from traceback import print_exc
@ -141,10 +143,10 @@ class TextBrowser(QWidget, dataget):
globalconfig["rendertext_using_internal"]["webview"] = currenttype = list( globalconfig["rendertext_using_internal"]["webview"] = currenttype = list(
globalconfig["rendertext"]["webview"].keys() globalconfig["rendertext"]["webview"].keys()
)[0] )[0]
__ = importlib.import_module(f"rendertext.internal.webview.{currenttype}") __ = importlib.import_module(
return __.TextLine(currenttype, self.webivewwidget.webview, self).gen_html__( f"rendertext.internal.webview.{currenttype}"
*args ).TextLine
) return __(currenttype, self.webivewwidget.webview, self).gen_html__(*args)
def _webview_append(self, _id, origin, atcenter, text, tag, flags, color): def _webview_append(self, _id, origin, atcenter, text, tag, flags, color):
text = text.replace("\n", "<br>").replace("\\", "\\\\") text = text.replace("\n", "<br>").replace("\\", "\\\\")