-
Notifications
You must be signed in to change notification settings - Fork 100
Updated XREF handling #121
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
Merged
Conversation
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
…ogic around determining whether XREFs get generated.
…represents an XREF or not.
…lues for <a> elements.
…s the function-xslt2.xsl template, so further tweaks will be needed to overall XSLT 2.0 processor logic.
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.
This pull request overhauls the handling of text nodes and hrefs in
<a>
elements as follows:<a>
element hasdata-type="xref"
on it, then its text node will be updated. If an<a>
element has anotherdata-type
(data-type="link"
) or nodata-type
, then the text node will not be updated. There is one exception, however. If an<a>
element doesn't havedata-type="xref"
on it, but does not havedata-type="link"
, and does have an empty text node, and does have an href that is not a Web URL, then the stylesheets will go ahead and try to add gentext.href
(e.g.,href="http://oreilly.com"
). This should never really happen (asdata-type="xref"
is intended for internal XREFs only), but if it does, the text node will be left untouched.href
can't be resolved, the gentext will be 3 question marks, and an error will be thrown in the log output.href
attributes on<a>
elements (aside from indexterms and footnoterefs, which are handled separately) will always be updated if they are internal cross-references. This ensures the href is accurate when HTMLBook files are consolidated for PDF or consolidated/rechunked for EPUB/Mobi.Also fixed a bug related to XSLT 1.0 processor compatibility that I inadvertently introduced for XSLT 2.0 compatibility. Stylesheets are not currently forward-compatible with XSLT 2.0, but will be addressing that in a future PR.