Skip to content

Commit

Permalink
Fix formatted shared strings (regressio in 1.7.0)
Browse files Browse the repository at this point in the history
  • Loading branch information
ebeigarts committed Aug 28, 2017
1 parent 5fe9b13 commit 0b8b11c
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions lib/saxlsx/shared_string_collection_parser.rb
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ def initialize(&block)
end

def start_element(name)
@current_string = '' if name == :si
@current_string = String.new if name == :si
end

def end_element(name)
Expand All @@ -27,7 +27,7 @@ def end_element(name)
end

def text(value)
@current_string = CGI.unescapeHTML(value) if @current_string
@current_string << CGI.unescapeHTML(value) if @current_string
end

end
Expand Down
Binary file modified spec/data/Spec.xlsx
Binary file not shown.
4 changes: 2 additions & 2 deletions spec/workbook_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,8 @@
it 'Shared strings' do
Workbook.open filename do |w|
w.should have(56).shared_strings
w.shared_strings[0].should eq 'LevenshteinDistance'
w.shared_strings[55].should eq 'TST_ModMan_Insulto_SU_Normal'
w.shared_strings.should include 'LevenshteinDistance'
w.shared_strings.should include 'TST_ModMan_Insulto_SU_Normal'
end
end

Expand Down

0 comments on commit 0b8b11c

Please sign in to comment.