-
Notifications
You must be signed in to change notification settings - Fork 74
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
XHTML: Bad nested <a> elements in 1.79.* #24
Comments
@rlpowell when did this start happening? |
If you follow my repro steps, I am comparing 1.78.1 with 1.79.1, as pulled by zip from sourceforge. I believe those are adjacent releases. |
Any ideas here? This seems like a pretty bad new bug, no? |
@rlpowell - I have no idea what caused it. Looking through the log, as best I can tell there isn't much of a history in this repo, and nothing obvious is to blame here. I am hoping one of the actual devs of this repo could help. Do you know whether it's still happening? |
This is an interesting one. I was able to reproduce your results using xsltproc (which is the xslt processor used by xmlto). When I ran the same test using Saxon, I got a different result with 1.79.1. Here it is:
With xsltproc, you get the nested link; with Saxon, there are two empty Clearly there's a problem with the stylesheets. If you have the option to use Saxon, that might be a stopgap. But I'll leave this as an open issues for the developers to look at. |
@rlhamilton thank you for looking at this. If there is a problem with the stylesheets, which dev might be the best to ask? I can try to fix this myself. |
I traced the problem through the stylesheets, and it is a bug introduced in 1.79.1. In response to issue #1359 on SourceForge, all the inline *.charseq templates were changed to process the content with simple.xlink when the $content template param was passed. Because the glossterm template already generates <a>, this nests a second link for that element. The solution is to change the call to inline.italicseq in the match="glossterm" template in inline.xsl from: That prevents the nested linking. Other elements that produce their own link should also have this change. If this bug is kept open I will work to integrate these changes for the next release. I will also provide my usual suggestion that since you are using DocBook 5 XML files that you should use the namespaced version of the stylesheets (docbook-xsl-ns-1.79.1 instead of docbook-xsl-1.79.1). That will prevent double processing of the file to strip the namespace and prevent potential problems with working with an internal nodeset instead of the content directly. 8^) |
Would it be OK if I make a pull request? |
Bob is the main developer, so I think this is already on his todo list. That said, I'm sure he'll let you know if he'd like you to create a pull request. Thanks, Bob, for finding the problem. |
Hello, can somebody say in which version it's fixed?
on Ubuntu 21.10 and have similar issue btw, thank you for great tools! |
I don't think there has been a formal release since that bug was fixed. However, it has been fixed in recent snapshots, which you can find here: https://github.com/docbook/xslt10-stylesheets/releases |
Thank you, actually I tried, but had some issues with import path, so just created python script for fix ) |
Given the input of:
(a pattern my book uses literally thousands of times), in 1.78.1 this turned into
and in 1.79.1 it turns into:
Look at the closing tags to see the problem.
This causes EPUB generation to fail, as it doesn't like nested
<a>
elements (and rightly so).To repro:
To make it even more clear you can do:
The key bit is:
The text was updated successfully, but these errors were encountered: