Supersede EPUB 2 meta tags with their EPUB 3 equivalents in otherMetadata - #866
Merged
Merged
Conversation
…data Fixes #85. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
stevenzeck
approved these changes
Aug 14, 2026
There was a problem hiding this comment.
🟡 Changes recommended
Add Equatable conformance to Syntax to fix compilation and move the changelog entry under Unreleased.
Get a fresh assessment by requesting another Copilot review.
Pull request overview
Updates EPUB metadata parsing so structured EPUB 3 metadata supersedes equivalent legacy EPUB 2 tags.
Changes:
- Tracks metadata syntax and filters superseded legacy values.
- Adds fixtures and regression tests.
- Updates metadata expectations and changelog.
File summaries
| File | Summary |
|---|---|
Tests/StreamerTests/Parser/EPUB/EPUBMetadataParserTests.swift |
Adds precedence coverage and updates expectations. |
Tests/StreamerTests/Parser/EPUB/EPUBManifestParserTests.swift |
Updates manifest metadata expectations. |
Tests/StreamerTests/Fixtures/OPF/other-metadata-precedence.opf |
Adds precedence fixture scenarios. |
Sources/Streamer/Parser/EPUB/OPFMeta.swift |
Implements syntax tracking and precedence filtering. |
CHANGELOG.md |
Documents the fix; entry should be moved to Unreleased. |
Review details
Suppressed comments (1)
CHANGELOG.md:97
- This new release-note section is below the
4.0.0-alpha.1heading, so the fix is attributed to an already released version instead of theUnreleasedsection at the top of the changelog. Move this entry into the UnreleasedFixed/Streamersection to keep release notes accurate.
### Fixed
#### Streamer
* When an OPF package document declares the same property with both a legacy EPUB 2 `<meta name=>` tag and a structured element (EPUB 3 `<meta property=>` or `<dc:x>`), the structured one now supersedes the legacy one in `otherMetadata`, instead of both values being kept ([#85](https://github.com/readium/swift-toolkit/issues/85)).
- Files reviewed: 5/5 changed files
- Comments generated: 1
- Review effort level: Lite
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #85.
When an OPF package document declares the same property with both an EPUB 2
<meta name= content=>tag and an EPUB 3<meta property=>(or<dc:x>) tag,otherMetadatanow keeps only the EPUB 3 value instead of both.OPFMetarecords whether a meta came from the legacy<meta name= content=>syntax or a structured element (<meta property=>/<dc:x>), andOPFMetaList.otherMetadatadrops legacy metas whose property is also expressed by a non-refining structured element. Legacy-only properties are preserved, and refining EPUB 3 metas do not supersede top-level legacy ones.Includes a new OPF fixture and unit test, plus updated expectations for the
full-metadatafixture which exercised the old behavior.🤖 Generated with Claude Code