File tree Expand file tree Collapse file tree 1 file changed +3
-1
lines changed
src/framework/components/element Expand file tree Collapse file tree 1 file changed +3
-1
lines changed Original file line number Diff line number Diff line change @@ -46,6 +46,7 @@ class MeshInfo {
46
46
const LINE_BREAK_CHAR = / ^ [ \r \n ] $ / ;
47
47
const WHITESPACE_CHAR = / ^ [ \t ] $ / ;
48
48
const WORD_BOUNDARY_CHAR = / ^ [ \t \- ] $ / ;
49
+ const CJK_CHAR = / ^ [ \u4E00 - \u9FFF ] $ / ;
49
50
50
51
// unicode bidi control characters https://en.wikipedia.org/wiki/Unicode_control_characters
51
52
const CONTROL_CHARS = [
@@ -885,7 +886,8 @@ class TextElement {
885
886
}
886
887
887
888
var isWordBoundary = WORD_BOUNDARY_CHAR . test ( char ) ;
888
- if ( isWordBoundary ) { // char is space, tab, or dash
889
+ var isCJK = CJK_CHAR . test ( char ) ;
890
+ if ( isWordBoundary || isCJK ) { // char is space, tab, or dash OR CJK
889
891
numWordsThisLine ++ ;
890
892
wordStartX = _xMinusTrailingWhitespace ;
891
893
wordStartIndex = i + 1 ;
You can’t perform that action at this time.
0 commit comments