fix: bing dict

This commit is contained in:
Gabe
2025-10-10 00:08:38 +08:00
parent 9bafc937d5
commit 769a4f00aa
2 changed files with 2 additions and 2 deletions

View File

@@ -140,7 +140,7 @@ export const apiMicrosoftDict = async (text) => {
const parser = new DOMParser(); const parser = new DOMParser();
const doc = parser.parseFromString(str, "text/html"); const doc = parser.parseFromString(str, "text/html");
const word = doc.querySelector("#headword > h1").textContent.trim(); const word = doc.querySelector("#headword > h1")?.textContent.trim();
if (!word) { if (!word) {
return null; return null;
} }

View File

@@ -35,7 +35,7 @@ function DictBody({ text, setCopyText, setRealWord, dict }) {
} }
if (!data) { if (!data) {
return <Typography>Empty result</Typography>; return <Typography>Not found!</Typography>;
} }
return ( return (