In topicpull, update "copy-shortdesc" template to process all @href values #4266
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.
Description
Updates
topicpull
processing to properly compute a topic link's description when the target topic contains a<shortdesc>
containing another<xref>
to a target file in a different directory.Motivation and Context
Fixes #4244.
The code in this template has been in place for at least 13 years, as shown by the following blame link:
https://github.com/dita-ot/dita-ot/blame/49975b0660689d34178612a930a3033f47f58c83/src/main/plugins/org.dita.base/xsl/preprocess/topicpullImpl.xsl#L1251
Perhaps back then, the test for
/
in the@href
value was becausetopicpull
document path resolution was not as robust. It seems to work fine now. If we find a case where it doesn't, we should fix the issue instead of returning***
as the inner link text.Once the requirement for lack of
/
is removed,xsl:choose
simplifies totrue()
.@href
values are handled by the first branch,@href
is always non-empty at the third branch.@href
values containing/
, thennot(contains(@href,'/')) or contains(@href,'/')
simplifies totrue()
.xsl:choose
can be simplified to just that processing.Side note - the
copy-shortdesc
template processing for<xref>
elements is the same as thecopy-shortdesc
identity template:except that PIs are not copied.
How Has This Been Tested?
I confirmed the fix with the #4244 testcase. I also ran the unit tests, although I don't think there is currently any test coverage of this
<xref>
-<shortdesc>
-<xref>
scenario, as I can replace it withand all tests still pass.
Type of Changes
Documentation and Compatibility
No documentation update is needed.
A release notes entry could be something like:
Checklist