Skip to content

Commit

Permalink
fix(xml2rfc): anchor for rfcsubseries’s referencegroup
Browse files Browse the repository at this point in the history
  • Loading branch information
strogonoff committed Jul 30, 2022
1 parent 4cb4ee6 commit 433ce72
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions bibxml/xml2rfc_adapters.py
Original file line number Diff line number Diff line change
Expand Up @@ -520,6 +520,17 @@ class RfcSubseriesAdapter(Xml2rfcAdapter):
])
"""Exhaustive set of all RFC subseries ID prefixes."""

def format_anchor(self) -> Optional[str]:
parts = self.anchor.split('.')
if len(parts) == 2:
try:
num = int(parts[1])
except (ValueError, TypeError):
return None
else:
return f'{parts[0]}{num}'
return None

@classmethod
def reverse(cls, item: BibliographicItem) -> List[ReversedRef]:
if ((docid := get_primary_docid(item.docid))
Expand Down

0 comments on commit 433ce72

Please sign in to comment.