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
69 stars 39 forks source link

id="identifiers" in HTML #930

Open cabo opened 2 years ago

cabo commented 2 years ago

Describe the issue

I now see id="identifiers", which clashes with document IDs:

https://github.com/ietf-wg-jsonpath/draft-ietf-jsonpath-base/issues/291

(I first mentioned this in https://github.com/ietf-tools/xml2rfc/issues/875#issuecomment-1302606581 -- that issue is otherwise unrelated.)

Code of Conduct

kesara commented 2 years ago

id="identifiers" is used to identify the document header section. https://www.rfc-editor.org/js/metadata.min.js uses this id and there are CSS rules specific to this id. I don't see a good solution to this issue other than a xml2rfc warning because,

cabo commented 2 years ago

I'm not sure I follow.

This bug only affects documents where the author has used an anchor "identifiers". So there should not be an issue with existing RFCs. For new documents (I-D or RFC), this "system" id should be chosen so that it doesn't conflict with "user" ids in the XML. 4NtsVrQEvSIvP6PsBImQocc8 would work for me. Maybe there is a better one. Since existing documents use id="identifiers" in a specific context, even a shared CSS file shouldn't have a problem.

cabo commented 2 years ago

(And I'm trying to find the place where specific anchor prefixes are reserved....)

kesara commented 2 years ago

(And I'm trying to find the place where specific anchor prefixes are reserved....)

https://datatracker.ietf.org/doc/html/rfc7992#section-6.5

cabo commented 2 years ago

Thanks -- that uses the identifiers (incorrectly, I would claim), but does not capture the implication that they need to be reserved (if XML anchors are used unchanged as HTML identifiers, that is).

I was looking for a different place that reserved section-x, table-x, etc....

kesara commented 2 years ago

I'm not sure I follow.

This bug only affects documents where the author has used an anchor "identifiers". So there should not be an issue with existing RFCs. For new documents (I-D or RFC), this "system" id should be chosen so that it doesn't conflict with "user" ids in the XML. 4NtsVrQEvSIvP6PsBImQocc8 would work for me. Maybe there is a better one. Since existing documents use id="identifiers" in a specific context, even a shared CSS file shouldn't have a problem.

The issue with existing RFCs is they have the following JavaScript:

<script src="https://www.rfc-editor.org/js/metadata.min.js"></script>

metadata.min.js has logic based on identifiers id. So I think any changes to this will require regenerating RFCs.

cabo commented 2 years ago

The JS could look whether there is a 4NtsVrQEvSIvP6PsBImQocc8, and only if that is not there, use identifiers.