ArthurHub / ArthurHub/HTML-Renderer

strange CJK text wrapping

Ouverte
#88 2 commentaires 0 réactions 1 personne assignée Réclamée par @Licshee Voir sur GitHub
bug
Langage dominant
C#
Étoiles
1.4k
Forks
550
Merge moyen
14 j 9 h
PR mergées (30 j)
1

Description

CJK text must be wrapped by box-width on word-break:normal.

Test HTML [https://jsfiddle.net/sv625phm/](url)

Result of HTML Renderer WPF Demo

あいうえおかきくけこさしすせそたちつてとなにぬねのはひふへほまみむめもやゆよらりるれろわをん

あいうえお漢字
かきくけこさしすせそたちつてとなにぬねの日
本語
はひふへほまみむめもやゆよらりるれろわをん

`HtmlRenderer\Core\Utils\CommonUtils.cs

///
/// Check if the given char is of Asian range.
///
/// the character to check
/// true - Asian char, false - otherwise
public static bool IsAsianCharecter(char ch)
{
//return ch >= 0x4e00 && ch <= 0xFA2D; // not enough for Japanese

return ('\u4E00' <= ch && ch <= '\u9FCF') // CJK統合漢字 CJK Unified Ideographs
|| ('\uF900' <= ch && ch <= '\uFAFF') // CJK互換漢字 CJK Compatibility Ideographs
|| ('\u3400' <= ch && ch <= '\u4DBF') // CJK統合漢字拡張A CJK Unified Ideographs Extension A
|| ('\u3041' <= ch && ch <= '\u309F') // ひらがな Hiragana
|| ('\u30A0' <= ch && ch <= '\u30FF') // 全角カタカナ Zenkaku Katakana
|| ('\u31F0' <= ch && ch <= '\u31FF') // 濁点と半濁点 Voice Sound Mark & Semi-Voice Sound Mark
|| ('\u3099' <= ch && ch <= '\u309C') // 中点と長音記号 Dot & Prolonged Sound Mark
|| ('\u3000' <= ch && ch <= '\u303f') // 句読点 CJK Symbols and Punctuation
;
}

`

Imploved

あいうえおかきくけこさしすせそたちつてとなに
ぬねのはひふへほまみむめもやゆよらりるれろ
わをん

あいうえお漢字かきくけこさしすせそたちつて
となにぬねの日本語はひふへほまみむめもや
ゆよらりるれろわをん

Guide de contribution

Aucun guide de contribution indexé pour ce dépôt

Évaluation

Cette issue n'a pas encore été évaluée.

Recevez les nouvelles issues par e-mail

Un résumé court des issues GitHub adaptées aux débutants.