Fix kyujitai links

rust
Elnu 2 years ago
parent 9496d5ba28
commit 407becbb6d

@ -24,7 +24,7 @@ for (let i = 0; i < rubies.length; i++) {
ruby.shinjitai = pair[0];
ruby.kyujitai = pair[1];
const encodedURIComponent = encodeURIComponent(pair[0]).toLowerCase();
if (ruby.parentNode.nodeName === "a" && ruby.parentNode.href.includes(encodedURIComponent) && ruby.parentNode.href.endsWith("%23kanji")) {
if (ruby.parentNode.nodeName === "A" && ruby.parentNode.href.includes(encodedURIComponent) && ruby.parentNode.href.endsWith("%23kanji")) {
ruby.parentNode.shinjitaiHref = ruby.parentNode.href;
ruby.parentNode.kyujitaiHref = ruby.parentNode.href.replace(encodedURIComponent, encodeURIComponent(pair[1]));
kyujitaiConvertableLinks.push(ruby.parentNode);

Loading…
Cancel
Save