fix(seautils): fixed broken regex

This commit is contained in:
Seaswimmer 2024-05-28 21:18:49 -04:00
parent ae8d0d5db4
commit ac5d4df36b
Signed by untrusted user: cswimr
GPG key ID: 5D671B5D03D65A7F

View file

@ -31,7 +31,7 @@ def md(soup: BeautifulSoup, **options) -> Any | str:
def convert_rfc_references(text: str, number: int) -> str:
one = re.sub(r"\(\.\/rfc(\d+)", r"(https://www.rfc-editor.org/rfc/rfc\1.html", text)
two = re.sub(r"\((#(?:section|page)-\d+)\)", f"(https://www.rfc-editor.org/rfc/rfc{number}.html\1)", one)
two = re.sub(r"\((#(?:section|page)-\d+(?:.\d+)?)\)", f"(https://www.rfc-editor.org/rfc/rfc{number}.html\1)", one)
return two
class SeaUtils(commands.Cog):