Skip to content

Supersede EPUB 2 meta tags with their EPUB 3 equivalents in otherMetadata - #866

Merged
mickael-menu merged 3 commits into
developfrom
fix-issue-85
Sep 18, 2026
Merged

mickael-menu merged 3 commits into
developfrom
fix-issue-85

Conversation

@mickael-menu

Copy link
Copy Markdown
Member

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, otherMetadata now keeps only the EPUB 3 value instead of both. OPFMeta records whether a meta came from the legacy <meta name= content=> syntax or a structured element (<meta property=> / <dc:x>), and OPFMetaList.otherMetadata drops 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-metadata fixture which exercised the old behavior.

🤖 Generated with Claude Code

…data

Fixes #85.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@mickael-menu
mickael-menu changed the base branch from swift6 to develop August 5, 2026 14:27
@mickael-menu
mickael-menu marked this pull request as ready for review September 18, 2026 13:49
Copilot AI lite review requested due to automatic review settings September 18, 2026 13:49

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🟡 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.1 heading, so the fix is attributed to an already released version instead of the Unreleased section at the top of the changelog. Move this entry into the Unreleased Fixed/Streamer section 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.

Comment thread Sources/Streamer/Parser/EPUB/OPFMeta.swift
@mickael-menu mickael-menu linked an issue Sep 18, 2026 that may be closed by this pull request
@mickael-menu
mickael-menu merged commit bb99367 into develop Sep 18, 2026
5 checks passed
@mickael-menu
mickael-menu deleted the fix-issue-85 branch September 18, 2026 14:55
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.

EPUB 2 meta tags should be superseded by EPUB 3 ones

3 participants