Skip to content

Commit 7ef7547

Browse files
authored
Update parser with rescue block
1 parent 9f706fe commit 7ef7547

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

lib/prawn/text/formatted/parser.rb

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -240,7 +240,8 @@ def self.array_from_tokens(tokens)
240240

241241
matches = /size=".*?(\d+(?:\.\d+)?).*?"/.match(token) ||
242242
/size='.*?(\d+(?:\.\d+)?).*?'/.match(token)
243-
sizes << Float(matches[1]) unless matches.nil?
243+
size = (Float(matches[1]) rescue nil) unless matches.nil?
244+
sizes << size unless size.nil?
244245

245246
matches = /character_spacing="([^"]*)"/.match(token) ||
246247
/character_spacing='([^']*)'/.match(token)

0 commit comments

Comments
 (0)