Content deleted Content added
Opencooper (talk | contribs) Undid revision 1057122235 by Opencooper (talk) |
Opencooper (talk | contribs) trying to support see tables that point to other entries |
||
Line 414:
// Wiktionary adds readings as furigana
var headword = parsed.find(".headword:lang(ja)").first();
var seeTable = parsed.find(".Jpan ruby").first();
var kanji = "";
var kana = "";
if (headword.length) {
for (let i = 0; i < childNodes.length; i++) {
var ruby = $(childNodes[i]); // convert back to JQuery for convenience
ruby.children("rp").remove();▼
kanji += ruby.text();
} else if (childNodes[i].nodeType == 3) { // "#text" kanji += childNodes[i].nodeValue;
kana += childNodes[i].nodeValue;
}
}
} else if (seeTable.length) {
kanji = seeTable.children("rb").text();
} else {
return;
}
if (kanji != wikidataKanji) { return; }
|