This is an automated email from the ASF dual-hosted git repository.

brondsem pushed a commit to branch db/8588
in repository https://gitbox.apache.org/repos/asf/allura.git

commit 62065c38bc3b9a2409594c04db18e7243dc42a15
Author: Dave Brondsema <[email protected]>
AuthorDate: Thu Nov 20 17:21:42 2025 -0500

    [#8588] recompile this bad regexp with the "regex" library which has better 
worst-case performance
---
 Allura/allura/lib/markdown_extensions.py | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/Allura/allura/lib/markdown_extensions.py 
b/Allura/allura/lib/markdown_extensions.py
index b576ab1ff..93a2904af 100644
--- a/Allura/allura/lib/markdown_extensions.py
+++ b/Allura/allura/lib/markdown_extensions.py
@@ -24,6 +24,7 @@
 
 from urllib.parse import urljoin
 
+import regex
 from tg import config
 from bs4 import BeautifulSoup, MarkupResemblesLocatorWarning
 import html5lib
@@ -361,6 +362,7 @@ class ForgeLinkPattern(markdown.inlinepatterns.Pattern):
     def __init__(self, *args, **kwargs):
         self.ext = kwargs.pop('ext')
         super().__init__(*args, **kwargs)
+        self.compiled_re = regex.compile(self.compiled_re.pattern, 
flags=self.compiled_re.flags)
 
     def handleMatch(self, m):
         el = etree.Element('a')

Reply via email to