-
Notifications
You must be signed in to change notification settings - Fork 183
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Apply a class to <em>'s containing Japanese characters #94
Conversation
const visit = require('unist-util-visit'); | ||
|
||
const hasJapanese = str => { | ||
return /[\u30a0-\u30ff\u3040-\u309f\u3005-\u3006\u30e0-\u9fcf。、]/.test(str); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[imo]
hasJapanese から推測できますが、一応 regex の範囲についてコメントしておいても良いかもしれません。
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
念のため確認してたらCJK統合漢字のコードポイント間違ってました…(コピペ元から間違ってました)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@potato4d コメントを加えてみましたが、ああいうことでよかったでしょうか |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
確認しました。問題ないと思います 👍
@smikitky 良いと思います〜! |
This fixes #22 .
em-ja
class to<em>
's that contain any Japanese character..em-ja
with bold instead of italic.環境によって日本語で em が正しくレンダリングされない問題を修正します。em で強調されている文字列に日本語文字が含まれている場合(例:
*あああ*
)、問答無用で太字にします。もし
yarn dev
で太字が反映されない場合はyarn reset
でキャッシュを削除してみてください。