Skip to content

Commit f81b423

Browse files
committed
feat: report as usage container resources not listed in manifest
EPUBCheck used to report any resource found in the the container but not listed in the manifest as a warning (since #58 was fixed, in v1.1). But the EPUB specification does not require that. This commit downgrades the severity of `OPF-003` to a usage report. See also #1452 See also w3c/epub-specs#563
1 parent 5bac4f8 commit f81b423

File tree

18 files changed

+62
-8
lines changed

18 files changed

+62
-8
lines changed

src/main/java/com/adobe/epubcheck/messages/DefaultSeverities.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -190,7 +190,7 @@ private void initialize()
190190
// OPF
191191
severities.put(MessageId.OPF_001, Severity.ERROR);
192192
severities.put(MessageId.OPF_002, Severity.FATAL);
193-
severities.put(MessageId.OPF_003, Severity.WARNING);
193+
severities.put(MessageId.OPF_003, Severity.USAGE);
194194
severities.put(MessageId.OPF_004, Severity.WARNING);
195195
severities.put(MessageId.OPF_004a, Severity.ERROR);
196196
severities.put(MessageId.OPF_004b, Severity.ERROR);

src/test/resources/epub-multiple-renditions/multiple-rendition-publication.feature

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,6 @@ Feature: EPUB Multiple-Rendition ▸ Full Publication Checks
8181
Then warning RSC-019 is reported (for the missing metatada.xml file)
8282
And warning RSC-017 is reported (for the missing selection attributes)
8383
And the message contains 'At least one rendition selection attribute should be specified for each non-first rootfile element'
84-
And warning OPF-003 is reported (for a mapping document without a link in the container.xml file)
8584
And no other errors or warnings are reported
8685

8786

src/test/resources/epub2/opf-publication.feature

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -72,10 +72,12 @@ Feature: EPUB 2 ▸ Open Packaging Format ▸ Full Publication Checks
7272
Then warning OPF-035 is reported
7373
And no other errors or warnings are reported
7474

75-
Scenario: Report a reference to a resource that is not listed in the manifest
76-
When checking EPUB 'opf-manifest-resource-undeclared-warning'
77-
Then warning OPF-003 is reported
78-
And no other errors or warnings are reported
75+
Scenario: Report (usage) a resource that is not listed in the manifest
76+
Given the reporting level is set to usage
77+
When checking EPUB 'opf-manifest-resource-undeclared-usage'
78+
Then usage OPF-003 is reported
79+
But no other usages are reported
80+
And no errors or warnings are reported
7981

8082
Scenario: Verify that operating system files (`.DS_STORE`, `thumbs.db`) are ignored (issue 256)
8183
When checking EPUB 'opf-manifest-os-files-ignore-valid'
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
<!DOCTYPE html>
2+
<html xmlns:epub="http://www.idpf.org/2007/ops" xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
3+
<head>
4+
<meta charset="utf-8"/>
5+
<title>Minimal EPUB</title>
6+
</head>
7+
<body>
8+
<h1>Loomings</h1>
9+
<p>Call me Ishmael.</p>
10+
</body>
11+
</html>

0 commit comments

Comments
 (0)