Skip audio, video tag in combine translation feature (#589)

# PR Checklist
- [ ] Did you check if it works normally in all models? *ignore this
when it dosen't uses models*
- [ ] Did you check if it works normally in all of web, local and node
hosted versions? if it dosen't, did you blocked it in those versions?
- [ ] Did you added a type def?

# Description
I'm sorry to repeat it so many times, but I think this is really the
last time
This commit is contained in:
kwaroran
2024-08-12 23:48:34 +09:00
committed by GitHub

View File

@@ -371,7 +371,7 @@ export async function translateHTML(html: string, reverse:boolean, charArg:simpl
node instanceof HTMLElement
) {
const children = Array.from(node.childNodes);
const blacklist = ["img", "iframe", "script", "style", "div", "button"];
const blacklist = ["img", "iframe", "script", "style", "div", "button", "audio", "video"];
const hasBlacklistChild = children.some((child) =>
blacklist.includes(child.nodeName.toLowerCase())
);