Skip to content

feat: add support for .wps and .et - #48

Open
Halfknow wants to merge 1 commit into
firecrawl:mainfrom
Halfknow:main
Open

feat: add support for .wps and .et#48
Halfknow wants to merge 1 commit into
firecrawl:mainfrom
Halfknow:main

Conversation

@Halfknow

@Halfknow Halfknow commented Aug 7, 2026

Copy link
Copy Markdown

Summary

Adds .wps (WPS Writer / Microsoft Works text) and .et (WPS Spreadsheet)
to the recognized extensions, routing them to the existing Doc and Excel
parsers respectively.

Modern WPS Office exports these as OLE2 compound files carrying the same
content streams their Microsoft counterparts mandate — WordDocument for
.wps, Workbook/Book for .et. anydoc's content-based detection
(from_bytes) already recognizes them by stream name; this change only
extends extension-based detection (from_extension / from_path) so files
named .wps or .et convert correctly without a rename.

Changes

  • src/lib.rs — register "wps" => Format::Doc and "et" => Format::Excel
    in Format::from_extension; update the Format::Doc and Format::Excel
    doc comments to note the shared-stream WPS wrappers.
  • README.md — list .wps under Word and .et under Excel in the
    supported-formats table.

No new parser, no new Format variant: both extensions reuse the existing
binary Word (formats/doc) and spreadsheet (formats/sheet via calamine)
frontends.

Why no binding changes

The Node / wasm / Python Format enums are public API surface. Since .wps
and .et reuse the existing Doc/Excel parsers, format_from_extension("wps")
correctly returns the existing Doc / Xlsx variant already exposed. Adding
new enum values would break JS/Python callers that branch on these strings,
so they are intentionally left unchanged.

Scope

Covers modern WPS Office / Microsoft Works .wps and modern WPS .et — the
OLE2-based variants with standard content streams. Legacy WPS 2000-era private
binary containers (no standard streams) are out of scope and degrade safely:
detection returns None/Unsupported rather than panicking.

Verification

  • cargo fmt --check
  • cargo clippy -p anydoc --all-targets -- -D warnings
  • cargo test -p anydoc — 208 unit + 8 snapshot + 1 robustness, all green ✅
  • Confirmed Format::from_extension returns Doc for wps/WPS and
    Excel for et/ET (case-insensitive); existing mappings unchanged.

View with [code]smith Autofix with [code]smith
Need help on this PR? Tag @codesmith-bot with what you need. Autofix is disabled.

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.

1 participant