CHANGELOG
View Source[0.2.0] - 2025-10-25
Added
SVG detection fix for files with XML declarations
- Fixed pattern matching order bug where SVG files with
<?xmldeclarations were incorrectly detected asapplication/xml - Added SVG range pattern early in magic table to check for
<svgtag anywhere in first 4KB - Now correctly detects all SVG variants including those with XML declarations, comments, DOCTYPE declarations, etc.
- Fixed pattern matching order bug where SVG files with
Updated tika.xml to September 2025 version
- Synced with Ruby Marcel's latest tika.xml (1100+ new MIME type definitions)
- Updated JavaScript MIME type from
application/javascriptto standardtext/javascript - Improved detection accuracy across hundreds of file formats
OLE2 Word document detection improvements
- Expanded WordDocument signature search range from 1152-4096 bytes to 0-10MB
- Fixed range offset handling to properly skip to
offset.firstbefore reading - Now correctly detects old Microsoft Word .DOC files with variable directory entry locations
Development tooling and quality improvements
- Added
.tool-versionsfor asdf version management (Elixir 1.19.0, OTP 28.1) - Added
.formatter.exswith Quokka plugin for enhanced code formatting - Added
.editorconfigfor consistent editor configuration - Added
.credo.exsfor comprehensive linting rules - Added comprehensive GitHub Actions CI workflow
- Matrix builds across Elixir 1.14-1.19 and OTP 25-28
- Warnings as errors enforcement
- Format checking, Credo strict mode, and Dialyzer on latest versions
- Modernized
mix.exswith proper docs, coverage, and packaging configuration
- Added
Changed
- Breaking: JavaScript files now return
text/javascriptinstead ofapplication/javascript- This aligns with the IANA standard MIME type for JavaScript
- Updated test fixtures to reflect correct MIME type
- Updated minimum Elixir requirement to ~> 1.14
- Fixed negative step warning in
String.slice(1..-1)→String.slice(1..-1//1) - Removed invalid test fixture
xml.xmlfrom SVG fixtures (plain XML, not SVG)
Fixed
- Pattern matching order bug where generic XML patterns matched before specific SVG patterns
- Range offset handling in magic byte matching (now properly skips to start offset)
- Test fixture organization (removed duplicate/incorrect fixtures)
[0.1.0] - 2022-XX-XX
Initial Release
Fork of the original chaskiq/ex-marcel package, which was itself a port of Rails Marcel to Elixir.
- MIME type detection by file extension
- MIME type detection by magic bytes (file content analysis)
- Support for combined extension + magic byte detection
- Based on Apache Tika magic database