steven-kraft / obsidian-markdown-furigana

Simple Markdown to Furigana Rendering Plugin for Obsidian
84 stars 10 forks source link

Include the CJK characters and BPMF symbols #4

Closed emisjerry closed 3 years ago

emisjerry commented 3 years ago

Hi, thanks for your convenient plugin. As you can see the following image, there's RUBY characters for BPMF symbols (for Tradition Chinese in Taiwan) and spelling characters (for Simplified Chinese in china).

I've made a test to expand the range of REGEXP, could you merge this change into your code? \u4E00 to \u9FFF should include the Japanese Kanji and Chinese Kanji.

If you don't want to merge, please let me know. Thanks.

const REGEXP = /{((?:[\u4E00-\u9FFF]|[a-zㄅ-ㄩぁ-んァ-ン])+)((?:\|[a-zㄅ-ㄩ˙ˊˇˋぁ-んァ-ン]*)+)}/gm;

Sample:

{漢字|かんじ},{漢字|ㄏㄢˋ|ㄗˋ},{漢字|han|zi}

image

steven-kraft commented 3 years ago

Oh interesting, I'll look into adding this. I feel like this would require a plugin name change though 😅

emisjerry commented 3 years ago

FYI: https://en.wikipedia.org/wiki/Ruby_character

steven-kraft commented 3 years ago

Pushed an update that removed the Japanese-Only limitations. Please let me know if there are any issues.

Thanks!