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

Fix incorrect parse for Excelx with inline rich text #504

Merged
merged 1 commit into from
Aug 19, 2020

Conversation

tomog105
Copy link
Contributor

Summary

I discovered that there is a problem that can not get the contents of inline rich text format cells, since v2.8.0.

Example: richtext_example.xlsx

$ ruby -Ilib -rroo -e 'p Roo::Excelx.new("/Users/ogoke/richtext_example.xlsx").cell("a", 1)'
# result in master
nil
# result in v2.7.1
"Example richtext"

And I examined, A behavior of inline rich text format was changed in Roo::Excelx::SheetDoc#cell_from_xml by 4f9b166.

Therefore, in this PR, a behavior of inline rich text format has been reverted to v2.7.1, and a test case of inline rich text format file is added.

Other Information

This test case file was generated by the following script.

require "bundler/inline"

gemfile do
  source "https://rubygems.org"
  gem "axlsx", "3.0.0.pre"
end

Axlsx::Package.new do |axlsx|
  axlsx.workbook.add_worksheet(name: "richtext") do |sheet|
    rt1 = Axlsx::RichText.new
    rt1.add_run("Example richtext", b: true)

    rt2 = Axlsx::RichText.new
    rt2.add_run("Example", b: true)
    rt2.add_run(" richtext", i: true)

    sheet.add_row [rt1, rt2]
  end
  axlsx.serialize("richtext_example.xlsx")
end

@coveralls
Copy link

Coverage Status

Coverage increased (+0.03%) to 94.394% when pulling 93ed697 on tomog105:fix_parse_richtext_xlsx into 4ec1104 on roo-rb:master.

2 similar comments
@coveralls
Copy link

Coverage Status

Coverage increased (+0.03%) to 94.394% when pulling 93ed697 on tomog105:fix_parse_richtext_xlsx into 4ec1104 on roo-rb:master.

@coveralls
Copy link

Coverage Status

Coverage increased (+0.03%) to 94.394% when pulling 93ed697 on tomog105:fix_parse_richtext_xlsx into 4ec1104 on roo-rb:master.

@simonoff simonoff merged commit 5339d3a into roo-rb:master Aug 19, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants