Skip to content
This repository was archived by the owner on Apr 12, 2021. It is now read-only.

Commit 93061f3

Browse files
Mike-Koderalafr
authored andcommitted
Fix bug with \n translation (foliojs#797)
This causes \n characters to be displayed more consistently.
1 parent 7839a41 commit 93061f3

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

lib/line_wrapper.coffee

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -92,8 +92,8 @@ class LineWrapper extends EventEmitter
9292
mustShrink = w > @spaceLeft and l > 0
9393
mightGrow = w <= @spaceLeft and l < word.length
9494

95-
# send a required break unless this is the last piece
96-
fbk.required = l < word.length
95+
# send a required break unless this is the last piece and a linebreak is not specified
96+
fbk.required = bk.required or l < word.length
9797
shouldContinue = fn word.slice(0, l), w, fbk, lbk
9898
lbk = required: false
9999

0 commit comments

Comments
 (0)