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.shinjitai = pair[0];
ruby.kyujitai = pair[1]; ruby.kyujitai = pair[1];
const encodedURIComponent = encodeURIComponent(pair[0]).toLowerCase(); 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.shinjitaiHref = ruby.parentNode.href;
ruby.parentNode.kyujitaiHref = ruby.parentNode.href.replace(encodedURIComponent, encodeURIComponent(pair[1])); ruby.parentNode.kyujitaiHref = ruby.parentNode.href.replace(encodedURIComponent, encodeURIComponent(pair[1]));
kyujitaiConvertableLinks.push(ruby.parentNode); kyujitaiConvertableLinks.push(ruby.parentNode);

Loading…
Cancel
Save