lib/write_xlsx/worksheet/hyperlink.rb in write_xlsx-1.09.5 vs lib/write_xlsx/worksheet/hyperlink.rb in write_xlsx-1.10.0

- old
+ new

@@ -1,6 +1,7 @@ # -*- encoding: utf-8 -*- +# frozen_string_literal: true module Writexlsx class Worksheet class Hyperlink # :nodoc: include Writexlsx::Utility @@ -97,13 +98,13 @@ # The displayed string defaults to the url string. str ||= url.dup # For external links change the directory separator from Unix to Dos. url = url.gsub(%r{/}, '\\') - str.gsub!(%r{/}, '\\') + str = str.gsub(%r{/}, '\\') # Strip the mailto header. - str.sub!(/^mailto:/, '') + str = str.sub(/^mailto:/, '') # Split url into the link and optional anchor/location. url, url_str = url.split(/#/, 2) # Escape URL unless it looks already escaped.