Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
OpenDAS
dynamo
Commits
bf270c28
Unverified
Commit
bf270c28
authored
Feb 09, 2026
by
dagil-nvidia
Committed by
GitHub
Feb 09, 2026
Browse files
refactor: optimize regex patterns in docs scripts (#5777)
parent
59d20d1e
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
3 deletions
+6
-3
docs/_extensions/github_alerts.py
docs/_extensions/github_alerts.py
+2
-1
docs/generate_docs.py
docs/generate_docs.py
+4
-2
No files found.
docs/_extensions/github_alerts.py
View file @
bf270c28
...
...
@@ -53,7 +53,8 @@ class GitHubAlertsTransformer:
def
__init__
(
self
):
# Regex to match GitHub alert syntax in text
self
.
alert_pattern
=
re
.
compile
(
r
"^\[!(.*?)\](?:\s+(.*))?$"
)
# Uses [^\]]* instead of .*? to prevent backtracking on ] characters
self
.
alert_pattern
=
re
.
compile
(
r
"^\[!([^\]]*)\](?:\s+(.*))?$"
)
def
is_github_alert_blockquote
(
self
,
node
:
nodes
.
block_quote
)
->
bool
:
"""
...
...
docs/generate_docs.py
View file @
bf270c28
...
...
@@ -39,7 +39,8 @@ dynamo_github_url_reg = re.compile(
)
# relpath_patn = r"]\s*\(\s*([^)]+)\)"
# Hyperlink in a .md file, excluding embedded images.
hyperlink_reg
=
re
.
compile
(
r
"((?<!\!)\[[^\]]+\]\s*\(\s*)([^)]+?)(\s*\))"
)
# Uses greedy [^)]+ instead of lazy [^)]+? to avoid backtracking with \s*
hyperlink_reg
=
re
.
compile
(
r
"((?<!\!)\[[^\]]+\]\s*\(\s*)([^)]+)(\))"
)
exclusions
=
None
with
open
(
f
"
{
dynamo_docs_abspath
}
/exclusions.txt"
,
"r"
)
as
f
:
...
...
@@ -225,7 +226,8 @@ def replace_hyperlink(m, src_doc_path):
should be safe for now.
"""
hyperlink_str
=
m
.
group
(
2
)
# Strip trailing whitespace since the greedy regex includes it
hyperlink_str
=
m
.
group
(
2
).
rstrip
()
match
=
http_reg
.
match
(
hyperlink_str
)
if
match
:
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment