fix: Only allow a single newline in when URLizing RFC tags (#4710)

Fixes #4705
This commit is contained in:
Lars Eggert 2022-11-05 17:22:56 +00:00 committed by GitHub
parent fbd9509db7
commit b6b48ec8f9
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -249,7 +249,7 @@ def urlize_ietf_docs(string, autoescape=None):
flags=re.IGNORECASE | re.ASCII,
)
string = re.sub(
r"\b(?<![/\-:=#\"\'])((RFC|BCP|STD|FYI)\s*0*(\d+))\b",
r"\b(?<![/\-:=#\"\'])((RFC|BCP|STD|FYI) *\n? *0*(\d+))\b",
link_other_doc_match,
string,
flags=re.IGNORECASE | re.ASCII,