Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cell_to_csv for double quote escaping changed all tr to gsub #212

Merged
merged 1 commit into from
May 28, 2015
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions lib/roo/base.rb
Original file line number Diff line number Diff line change
Expand Up @@ -663,9 +663,9 @@ def cell_to_csv(row, col, sheet)

case celltype(row, col, sheet)
when :string
%("#{onecell.tr('"', '""')}") unless onecell.empty?
%("#{onecell.gsub('"', '""')}") unless onecell.empty?
when :boolean
%("#{onecell.tr('"', '""').downcase}")
%("#{onecell.gsub('"', '""').downcase}")
when :float, :percentage
if onecell == onecell.to_i
onecell.to_i.to_s
Expand All @@ -675,7 +675,7 @@ def cell_to_csv(row, col, sheet)
when :formula
case onecell
when String
%("#{onecell.tr('"', '""')}") unless onecell.empty?
%("#{onecell.gsub('"', '""')}") unless onecell.empty?
when Float
if onecell == onecell.to_i
onecell.to_i.to_s
Expand All @@ -692,7 +692,7 @@ def cell_to_csv(row, col, sheet)
when :time
integer_to_timestring(onecell)
when :link
%("#{onecell.url.tr('"', '""')}")
%("#{onecell.url.gsub('"', '""')}")
else
fail "unhandled celltype #{celltype(row, col, sheet)}"
end || ''
Expand Down