From 58245c621cfdc71cdab576de3177fb23b8019894 Mon Sep 17 00:00:00 2001 From: Seaswimmer Date: Tue, 28 May 2024 21:58:20 -0400 Subject: [PATCH] misc(seautils): changed a function name --- seautils/seautils.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/seautils/seautils.py b/seautils/seautils.py index b37bdd6..06e704e 100644 --- a/seautils/seautils.py +++ b/seautils/seautils.py @@ -29,7 +29,7 @@ from redbot.core.utils.views import SimpleMenu def md(soup: BeautifulSoup, **options) -> Any | str: return MarkdownConverter(**options).convert_soup(soup) -def convert_rfc_references(text: str, number: int) -> str: +def format_rfx_text(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+(?:.\d+)?)\)", f"(https://www.rfc-editor.org/rfc/rfc{number}.html\1)", one) three: str = re.sub(r"\n{3,}", "\n\n", two) @@ -211,7 +211,7 @@ class SeaUtils(commands.Cog): pre_tags = soup.find_all('pre') content: list[Embed | str] = [] for pre_tag in pre_tags: - text = convert_rfc_references(md(pre_tag), number) + text = format_rfx_text(md(pre_tag), number) if len(text) > 4096: pagified_text = cf.pagify(text, delims=["\n\n"], page_length=4096) for page in pagified_text: