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
Child navigation links to nested topics are incorrect/missing if there is a <ph keyref/> #3867
Comments
The issue occurs in this part of the
In the "good" case (no
In the "bad" case (topic file contains a
It looks like the keyref causes the second topic file to be duplicated to topic-1.dita, but the subtopic ID suffixes are not preserved during the duplication. Unfortunately the issue is inside the |
I think the https://github.com/dita-ot/dita-ot/blob/develop/src/main/java/org/dita/dost/module/KeyrefModule.java but I don't know enough Java to follow exactly how the rename is performed or how the URI fragment should be preserved. |
In the method "org.dita.dost.module.KeyrefModule.walkMap" there is a call to "stripFragment" which probably is the one removing the anchor.
and then further down in the two places where the referenceValue is computed add the anchor back if it originally was there.
|
@raducoravu - this worked perfectly on the testcase! I'll do more testing on larger books in our collection. If everything looks good, I'll submit a pull request. Thank you! |
Signed-off-by: chrispy <chrispy@synopsys.com>
…keyref fix for #3867: Child navigation links to nested topics are incorrect/missing if there is a <ph keyref/>
@jelovirt and @infotexture it seems that the pull request was merged into develop branch and not in hotfixes/3.7.1. So the fix is not available neither in DOT 3.7.1 nor 3.7.2. You should consider cherry picking this fix for a 3.7.3 and updating the release notes to remove the reference to this fix. |
Signed-off-by: chrispy <chrispy@synopsys.com> (cherry picked from commit 2792509)
@jlacour31 Thanks for bringing this to our attention. I've ported the original fix from #3874 to 3.7.3 with #3945 and updated the 3.7.1 Release Notes in the |
- dita-ot/dita-ot#3867 (comment) - dita-ot/dita-ot#3874 - dita-ot/dita-ot#3945 Signed-off-by: Roger Sheen <roger@infotexture.net>
Actual Behavior
When all of the following are true:
<ph keyref="..."/>
reference.then if I run the
html5
transformation, the child navigation links for the second submap's topic instance are missing, which causes all child links to point to the top-level topic instead of the nested topics:If I run the
pdf2
transformation instead of thehtml5
transformation (which usespreprocess2
instead ofpreprocess
), then I get an even weirder result of recursively nested links that are a mix of correct and incorrect links.Expected Behavior
Child links should resolve correctly, whether there is a
<ph keyref="..."/>
or not.If the
<ph keyref="..."/>
element is deleted, then the child navigation links are gathered correctly:Possible Solution
I am not sure yet, but I will follow up if I figure something out.
Steps to Reproduce
incorrect_nested_topic_links.zip
dita -i map.ditamap -f html5 -o out
Environment
linux
dita
commandhtml5
,pdf2
The text was updated successfully, but these errors were encountered: