-
Notifications
You must be signed in to change notification settings - Fork 402
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: allow remote resources in scripted content
Message changes: - message `OPF-018` (`WARNING`) is only reported when a Content Doc is declared in the Package Document with the property `remote-resource`, and neither remote references nor scripts are found. - new message `OPF-018b` (`USAGE`) reported when a Content Doc is declared in the Package Document with the property `remote-resource`, and no remote references are found but the Content Doc has scripted content. - message `RSC-006` (`ERROR`) is only reported when a remote publication resource is declared in the Package Document with a type that doesn't specifically allow it to be located outside the container, and when it is directly referenced from a Content Document, or used in the spine, or else if there is no scripted content in the publication. - new message `RSC-006b` (`USAGE`) is reported when a remote publication resource is declared in the Package Document with a type that doesn't specifically allow it to be located outside the container, and scripted content is found. Internal changes: - new utility static method `OPFChecker.isScriptType(String)` tells if a media type is a JavaScript MIME type essence match (see https://mimesniff.spec.whatwg.org/#javascript-mime-type-essence-match) - better identify scripted content: from event handler attributes, or script element with a type matching a JavaScript MIME type essence. - add a couple tests and fix existing tests Fix #869. fixup: better check remote resources
- Loading branch information
Showing
41 changed files
with
449 additions
and
51 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
6 changes: 6 additions & 0 deletions
6
src/test/resources/30/expanded/invalid/remote-img-also-in-link/META-INF/container.xml
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
<?xml version="1.0" encoding="UTF-8" ?> | ||
<container version="1.0" xmlns="urn:oasis:names:tc:opendocument:xmlns:container"> | ||
<rootfiles> | ||
<rootfile full-path="OPS/package.opf" media-type="application/oebps-package+xml"/> | ||
</rootfiles> | ||
</container> |
Oops, something went wrong.