ArthurHub / ArthurHub/HTML-Renderer

strange CJK text wrapping

Open
#88 2 comments 0 reactions 1 assignee Claimed by @Licshee View on GitHub
bug
Dominant language
C#
Stars
1.4k
Forks
550
Avg merge
14d 9h
Merged PRs (30d)
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

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

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

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.