Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

This fixes issue #73 #82

Closed
wants to merge 1 commit into from

2 participants

@Nathanaela

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

@pietervandereems

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.

@Nathanaela

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/text.coffee
View
2  lib/mixins/text.coffee
@@ -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.