-
Notifications
You must be signed in to change notification settings - Fork 405
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
EPUB-defined navigation lists must not reference remote resources #890
Comments
Matt suggested the following Schematron snippet (thanks!): <pattern id="no-remote-refs">
<rule context="html:a[ancestor::html:nav[contains('toc|landmarks|page-list',@epub:type)]]">
<report test=".[matches(@href, '.+?://')]">Hyperlinks in toc, landmarks and page-list nav elements must not reference resources outside the container</report>
</rule>
</pattern> However we may have a more robust facility in the Java code to test the in-container-ness. In addition, this would allow the message to be localizable (while schematron messages currently aren't). Let's see if it's easy to do in Java, otherwise we'll fallback to the schematron solution. |
Ya, this is probably better done in java as the testing just relies on some protocol at the start. To be safe it would really need to tokenize the epub:type value, too, so something more like:
|
just a clarification: it's not only about remote resources, an embedded (non-top-level) local resource is disallowed too, correct? |
If you mean referencing a resource outside of its use within a top-level content document, then no. The fragment identifier has to occur within a top-level content document for the three epub navs. |
ok, I think I was confused by the following statement:
which sounds more open that it is. In reality, it can only reference either Top-level Content Documents or remote resources. Other non-top-level-content-document Publication Resources are disallowed, by virtue of the
Maybe the first statement could be made clearer by rewording it to something like:
|
Yes, that language is a bit overzealous. I think it may have slipped through from earlier discussions, as I seem to recall questions of whether data sets and other items of interest in the container could be listed. I can't find any evidence that we agreed to loosen it that much, only to allow remote references: w3c/epub-specs#594 |
A new message `NAV_010` (`ERROR`) is reported when a `toc`, `landmarks`, or `page-list` nav contains links to remote resources. Fix #890
A new message `NAV_010` (`ERROR`) is reported when a `toc`, `landmarks`, or `page-list` nav contains links to remote resources. Fix #890
The toc, page-list and landmarks navs must reference only in-spine content documents.
All other nav elements can reference both internal and external resources.
Reference: https://w3c.github.io/publ-epub-revision/epub32/spec/epub-packages.html#confreq-nav-a-href-default
The text was updated successfully, but these errors were encountered: