From 22a44d82c5d0de24ed3179006e5e6c2452868d12 Mon Sep 17 00:00:00 2001 From: Glenn Jocher Date: Mon, 22 Jul 2024 16:43:09 +0200 Subject: [PATCH] Plaintext negative lookbehind scan (#14601) Signed-off-by: Glenn Jocher --- docs/build_docs.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/build_docs.py b/docs/build_docs.py index a6fd39b0..181455c3 100644 --- a/docs/build_docs.py +++ b/docs/build_docs.py @@ -193,7 +193,7 @@ def convert_plaintext_links_to_html(content): for text_node in paragraph.find_all(string=True, recursive=False): if text_node.parent.name not in {"a", "code"}: # Ignore links and code blocks new_text = re.sub( - r'(https?://[^\s\'")]+)(?=[,.!?;:]?(?:\s|$)|[\'")])', + r'(https?://[^\s()<>]+(?:\.[^\s()<>]+)+)(?\1', str(text_node), )