ietf-tools / xml2rfc

Generate RFCs and IETF drafts from document source in XML according to the IETF xml2rfc v2 and v3 vocabularies
https://ietf-tools.github.io/xml2rfc/
BSD 3-Clause "New" or "Revised" License
71 stars 39 forks source link

xml anchor elements not used (anymore?) #1156

Closed reschke closed 2 months ago

reschke commented 2 months ago

Describe the issue

It appears that xml2rfc now throws away anchor information from the source document and always uses the "slugifiedName".

Example from rfc9110.xml:

    <section anchor="range.requests" numbered="true" removeInRFC="false" toc="include" pn="section-14">
      <name slugifiedName="name-range-requests">Range Requests</name>

So "range.request" should appear in the HTML.

However (rfc9110.html):

 <h2 id="name-range-requests">
<a href="#section-14" class="section-number selfRef">14. </a><a href="#name-range-requests" class="section-name selfRef">Range Requests</a>
      </h2>

I believe in the past it used both (one for "id=" one for "href=").

In any case, this is a serious problem as it breaks existing anchors in content.

Code of Conduct

reschke commented 2 months ago

Sorry for the noise; apparently the "proper" anchor is on the enclosing element.

It's still bad that the "self link" chooses the wrong anchor, though.

royfielding commented 2 months ago

It is not appropriate for the tools to override the anchor names chosen by the authors. We deliberately chose those names and expect them to appear in all section and ToC references. It is still a bug even if the old references work, since we do not want two or three alias names for every section ref. We only want the ones that are authored in the XML.