dita-ot / dita-ot

DITA Open Toolkit — the open-source publishing engine for content authored in the Darwin Information Typing Architecture.
https://www.dita-ot.org
Apache License 2.0
386 stars 193 forks source link

xref link to a list is not working when the topic is used as conref in another topic and published with transtype xhtml #4472

Closed Roopesh-Navath closed 3 weeks ago

Roopesh-Navath commented 3 weeks ago

Expected Behavior

xref link should work as a normal link

Actual Behavior

link is broken due to the wrong xref id generated

Possible Solution

xref id should be generated using the target element id

Steps to Reproduce

1.create a bookmap, keymap and 2 topics and use one topic inside bookmap and use other one as conref inside another topic

  1. add ul list with specific id and link this list using xref in the same topic
  2. use this topic as conref in another topic
  3. publish xhtml and observe the link
  4. link is broken

ouptut html

<p class="p">link to topic 1 list <a class="xref" href="#id_mjp_kh5_hbc__d36e25">#id_mjp_kh5_hbc__d36e25</a>
                    </p>
                    <ul class="ul" id="id_mjp_kh5_hbc__ul-list">
                        <li class="li">
                            <p class="p">topic 1 list item</p>
                        </li>
                        <li class="li">
                            <p class="p">topic 1 list item 2</p>
                        </li>
                    </ul>

sample-code

Copy of the error message, log file or stack trace

log

Environment

raducoravu commented 3 weeks ago

In such cases the link href should be "#./ul-list"

https://www.oxygenxml.com/dita/1.3/specs/archSpec/base/uri-based-addressing.html#uri-based-addressing__topics-with-uri