Skip to content


Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP


This fixes issue #73 #82

wants to merge 1 commit into from

2 participants


If you do a .text("") or .text(" ") the words = null, so the next line the words.length is invalid.


This fix has the draw back that the original string is not added to the pdf.
Since the regexp will also return null on a string like "???" I think it's better to use [text] as default value on the regexp.
Added a pull request with that fix.


This has been fixed in a more recent version so this pull request is no longer valid.

@Nathanaela Nathanaela closed this
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Jul 13, 2012
  1. @Nathanaela
This page is out of date. Refresh to see the latest.
Showing with 1 addition and 1 deletion.
  1. +1 −1  lib/mixins/
2  lib/mixins/
@@ -189,7 +189,7 @@ module.exports =
wrap.maxY = @y + options.height - @currentLineHeight()
# split the line into words
- words = text.match(WORD_RE)
+ words = text.match(WORD_RE) or []
# calculate the extra width
wrap.extraSpace = (options.wordSpacing or 0) * (words.length - 1) + # wordSpacing
Something went wrong with that request. Please try again.