Skip to content
Open
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions rfc2html.py
Original file line number Diff line number Diff line change
Expand Up @@ -276,6 +276,10 @@ def reference_replacement(match):
text = re.sub("(?m)^(\s*)(\d+(\.\d+)*)(\.?[ ]+)(.*[^ .])( *\. ?\.)(.*[0-9])$", """\g<1><a href="#section-\g<2>">\g<2></a>\g<4>\g<5>\g<6>\g<7>""", text)
text = re.sub("(?m)^(\s*)(Appendix |)([A-Z](\.\d+)*)(\.?[ ]+)(.*[^ .])( *\. ?\.)(.*[0-9])$", """\g<1><a href="#appendix-\g<3>">\g<2>\g<3></a>\g<5>\g<6>\g<7>\g<8>""", text)

# anchor markup: abstract, toc
text = re.sub("(?m)^(\s*)(Abstract)$", """\g<1><a id="abstract" href="#abstract" class="selflink">\g<2></a>""", text, count=1)
text = re.sub("(?m)^(\s*)(Table of Contents)$", """\g<1><a id="table-of-contents" href="#table-of-contents" class="selflink">\g<2></a>""", text, count=1)

# page number markup
multidoc_separator = "========================================================================"
if re.search(multidoc_separator, text):
Expand Down