You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@allura.apache.org by br...@apache.org on 2025/11/20 23:34:01 UTC
(allura) 01/04: [#8588] recompile this bad regexp with the "regex" library which has better worst-case performance
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 87fb1a290015a0026cf1dffef1cfa87974f4a901
Author: Dave Brondsema <db...@slashdotmedia.com>
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')