Pull Request to Markdown Furigana Plugin: Now supporting all non-Western scripts

This may be of use to language learners:

I just created a pull request for the Markdown Furigana plugin, which adds support to all non-Western scripts. Furigana usually means an a Japanese reading aid consisting of smaller kana (syllabic characters) printed either above or next to kanji (logographic characters) (Wikipedia):
image

However, I thought it might be useful if you want to include information about the reading or transliteration for other languages, Arabic, Hindi, or anything really. You can then include information about it in the target language, as they do with the real Furigana, or in English or whatever other language you want:

ChatGPT helped with the regex , and also with the examples here. I think most of them just say the language name in the respective script, except Arabic and Hebrew for some reason

I don’t know how to roll up the typescript on Github to a .js file usable for Obsidian (I’m not a programmer)

But you can just have a look at the original plugin file and edit that directly.

Replace this one

// ORIGINAL - Regular Expression for {{kanji|kana|kana|...}} format - ORIGINAL 
const REGEXP = /{((?:[\u2E80-\uA4CF\uFF00-\uFFEF])+)((?:\\?\|[^ -\/{-~:-@\[-`]*)+)}/gm;

with

// WORKING - ALL NON-WESTERN SCRIPTS
const REGEXP = /{((?:[\u2E80-\uA4CF\uFF00-\uFFEF\u0900-\u097F\u0980-\u09FF\u0A00-\u0A7F\u0A80-\u0AFF\u0B00-\u0B7F\u0B80-\u0BFF\u0C00-\u0C7F\u0C80-\u0CFF\u0D00-\u0D7F\u0600-\u06FF\u0750-\u077F\u08A0-\u08FF\u3040-\u309F\u30A0-\u30FF\uAC00-\uD7AF\u0E00-\u0E7F\u0590-\u05FF\u0700-\u074F\u20000-\u2A6DF\u2A700-\u2B73F\u2B740-\u2B81F\u2B820-\u2CEAF])+)((?:\\?\|[^ -\/{-~:-@\[-`]*)+)}/gm;

Make sure to comment out or delete the original, as the commands seem to clash.

Pull request: Update main.ts to support all Non-Western Scripts by ReaderGuy42 · Pull Request #26 · steven-kraft/obsidian-markdown-furigana · GitHub

Any feedback welcome :slight_smile: