diff options
Diffstat (limited to 'src/layout/engine.nim')
-rw-r--r-- | src/layout/engine.nim | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/layout/engine.nim b/src/layout/engine.nim index 7de2585e..a9dca1e6 100644 --- a/src/layout/engine.nim +++ b/src/layout/engine.nim @@ -647,6 +647,10 @@ proc checkWrap(ictx: var InlineContext, state: var InlineState, r: Rune) = state.prevrw = rw if ictx.word.str.len == 0: state.firstrw = rw + if rw >= 2: + # remove wrap opportunity, so we wrap properly on the last CJK char (instead + # of any dash inside CJK sentences) + ictx.wrappos = -1 case state.computed{"word-break"} of WORD_BREAK_NORMAL: if rw == 2 or ictx.wrappos != -1: # break on cjk and wrap opportunities |