Skip to content
Open
Changes from 1 commit
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
5 changes: 5 additions & 0 deletions lib/docx/document.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,11 @@
require 'nokogiri'
require 'zip'

# Disable ZIP64 support to maintain compatibility with version 0.9.1 and
# ensure compatibility with all readers. Rubyzip 3.x enables ZIP64 by default,
# but many readers (including pandoc) don't support it for small files.
Zip.write_zip64_support = false
Copy link

Copilot AI Dec 6, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Setting global Zip configuration in a library gem is problematic. This modifies global state for all code using rubyzip in the consuming application, potentially breaking other functionality that may need ZIP64 support.

Consider investigating per-operation ZIP64 configuration instead of global configuration. If rubyzip 3.x doesn't support per-operation configuration, consider:

  1. Documenting this global configuration change prominently in README and CHANGELOG
  2. Providing a configuration option that allows users to opt-in/out of this behavior
  3. Only setting this configuration in the save and stream methods and restoring it afterwards

This approach would minimize side effects on other code while achieving the same compatibility goal.

Copilot uses AI. Check for mistakes.

module Docx
# The Document class wraps around a docx file and provides methods to
# interface with it.
Expand Down