Revert "Fixed build docs regex security" (#17027)

pull/17019/head
Ultralytics Assistant 1 month ago committed by GitHub
parent 92cc8b8b52
commit 31b357b8a7
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
  1. 2
      docs/build_docs.py

@ -199,7 +199,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'\b(https?://(?:[a-zA-Z0-9-]+\.)+[a-zA-Z]{2,}(?:/[a-zA-Z0-9\-._~:/?#[\]@!$&\'()*+,;=%]*)?)(?<![.,:;\'"])',
r'(https?://[^\s()<>]+(?:\.[^\s()<>]+)+)(?<![.,:;\'"])',
r'<a href="\1">\1</a>',
str(text_node),
)

Loading…
Cancel
Save