mirror of
https://github.com/foliojs/pdfkit.git
synced 2025-12-08 20:15:54 +00:00
Merge pull request #152 from Nathanaela/Text_Wrapping_Fix
Fix bug in Line_Wrapper ignoring \n in most cases. (Causes text wrapping to be wrong)
This commit is contained in:
commit
d2b728fdff
@ -64,7 +64,7 @@ class LineWrapper extends EventEmitter
|
||||
for word, wi in words
|
||||
w = wordWidths[word] ?= width(word, options) + charSpacing + wordSpacing
|
||||
|
||||
if w > spaceLeft
|
||||
if w > spaceLeft or word is '\n'
|
||||
options.textWidth = width(buffer.trim(), options) + wordSpacing * (wc - 1)
|
||||
@emit 'line', buffer.trim(), options, this
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user