User:Opencooper/showKanji-dev.js: Difference between revisions

Content deleted Content added
doh
reuse our regexes
Line 313:
kana = kana.replace(/[・、 ]$/, "");
 
// Abort if our reading is only katakana (for non-Latin) or Latin
if ((!kanjiRegexes.latinOnly.test(wikidataKanji) && /^[ァ-ヴー]+$/kanjiRegexes.katakanaOnly.test(kana))
|| /^\w+$/kanjiRegexes.latinOnly.test(kana)) {
console.log("showKanji-dev.js: throwing away reading: " + kana);
getWiktionary();