lib/write_xlsx/worksheet.rb in write_xlsx-0.85.3 vs lib/write_xlsx/worksheet.rb in write_xlsx-0.85.4
- old
+ new
@@ -1781,28 +1781,32 @@
write_row(*args)
elsif token.respond_to?(:coerce) # Numeric
write_number(*args)
elsif token =~ /^\d+$/
write_number(*args)
- # Match http, https or ftp URL
- elsif token =~ %r|\A[fh]tt?ps?://|
- write_url(*args)
- # Match mailto:
- elsif token =~ %r|\Amailto:|
- write_url(*args)
- # Match internal or external sheet link
- elsif token =~ %r!\A(?:in|ex)ternal:!
- write_url(*args)
# Match formula
elsif token =~ /^=/
write_formula(*args)
# Match array formula
elsif token =~ /^\{=.*\}$/
write_formula(*args)
# Match blank
elsif token == ''
row_col_args.delete_at(2) # remove the empty string from the parameter list
write_blank(*row_col_args)
+ elsif @workbook.strings_to_urls
+ # Match http, https or ftp URL
+ if token =~ %r|\A[fh]tt?ps?://|
+ write_url(*args)
+ # Match mailto:
+ elsif token =~ %r|\Amailto:|
+ write_url(*args)
+ # Match internal or external sheet link
+ elsif token =~ %r!\A(?:in|ex)ternal:!
+ write_url(*args)
+ else
+ write_string(*args)
+ end
else
write_string(*args)
end
end