Skip to content

Commit

Permalink
Use Zip glob to match any document.xml
Browse files Browse the repository at this point in the history
Fixes #103
  • Loading branch information
WaKeMaTTa authored May 4, 2021
1 parent c65ef03 commit 940dd93
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions lib/docx/document.rb
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,7 @@ def initialize(path_or_io, options = {})
@zip = Zip::File.open_buffer(path_or_io)
end

document = @zip.find_entry('word/document.xml')
document ||= @zip.find_entry('word/document2.xml')
document = @zip.glob('word/document*.xml').first
raise Errno::ENOENT if document.nil?

@document_xml = document.get_input_stream.read
Expand Down

0 comments on commit 940dd93

Please sign in to comment.