From fa1b5ae8598a3ceef5eb186535926a7e1e827f31 Mon Sep 17 00:00:00 2001 From: test123456654321 <16307130148@fudan.edu.cn> Date: Sat, 26 Oct 2024 16:37:05 +0800 Subject: [PATCH] fix --- src/LunaTranslator/cishu/jisho.py | 4 +++- src/plugins/CMakeLists.txt | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/LunaTranslator/cishu/jisho.py b/src/LunaTranslator/cishu/jisho.py index 56b8acc4..e8798a32 100644 --- a/src/LunaTranslator/cishu/jisho.py +++ b/src/LunaTranslator/cishu/jisho.py @@ -127,7 +127,7 @@ document.querySelectorAll('.tab-widget_xxxxxx_internal .tab-button_xxxx_internal ) stl = requests.get(ss.group()[6:-1], proxies=self.proxy).text saver["style"] = stl - saver["primary"] = get_element_by("id", "main_results", res) + res.replace( + saver["primary"] = get_element_by("id", "result_area", res) + res.replace( get_element_by("id", "main_results", res), get_element_by("id", "primary", res), ) @@ -154,6 +154,8 @@ document.querySelectorAll('.tab-widget_xxxxxx_internal .tab-button_xxxx_internal res.append(("Words", saver["primary"])) if saver.get("secondary"): res.append(("Others", saver["secondary"])) + if not res: + return return "".format( saver.get("style", "") ) + self.generatehtml_tabswitch(res) diff --git a/src/plugins/CMakeLists.txt b/src/plugins/CMakeLists.txt index 58913458..1a3e093d 100644 --- a/src/plugins/CMakeLists.txt +++ b/src/plugins/CMakeLists.txt @@ -29,7 +29,7 @@ include(generate_product_version) set(VERSION_MAJOR 5) set(VERSION_MINOR 50) -set(VERSION_PATCH 3) +set(VERSION_PATCH 4) add_library(pch pch.cpp) target_precompile_headers(pch PUBLIC pch.h)