ietf-tools / ietf-tools/xml2rfc

Hardwired term "Part"

Open
#652 6 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

html medium under_review
Dominant language
HTML
Stars
124
Forks
79
Avg merge
6h 30m
Merged PRs (30d)
3

Description

type_defect | by cabo@tzi.org


The current code seems to assume an xref with an @relative always goes to a "Part" if not a "Section" or "Appendix". The correct word in my test case would be "subregistry".

Test case:

<xref section="senml-features" sectionFormat="of" target="IANA.senml" relative="#senml-features"/>

➔ [TXT, HTML]

   Part senml-features of [IANA.senml]

   <a href="http://www.iana.org/assignments/senml#senml-features" class="relref">Part senml-features</a> of [<a href="#IANA.senml" class="xref">IANA.senml</a>]

Code:

File: writers/html.py
2809:116:            label = 'Section' if section[0].isdigit() else 'Appendix' if re.search(r'^[A-Z](\.|$)', section) else 'Part'
File: writers/text.py
4706:116:            label = 'Section' if section[0].isdigit() else 'Appendix' if re.search(r'^[A-Z](\.|$)', section) else 'Part'

Issue migrated from trac:652 at 2022-02-08 07:16:08 +0000

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the xref label logic shown in writers/html.py around line 2809 and writers/text.py around line 4706, then trace how the section value is classified. Use the senml-features example as the regression case and verify that both TXT and HTML output use the intended label instead of the hardwired "Part".

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
tooling
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.