Fixes #7981: Fix Markdown sanitization regex

This commit is contained in:
jeremystretch
2021-12-06 11:33:00 -05:00
parent f41fd8256e
commit c04503fb66
2 changed files with 6 additions and 2 deletions

View File

@@ -51,7 +51,7 @@ def render_markdown(value):
value = re.sub(pattern, '[\\1](\\3)', value, flags=re.IGNORECASE)
# Sanitize Markdown reference links
pattern = fr'\[(.+)\]:\w?(?!({schemes})).*:(.+)'
pattern = fr'\[(.+)\]:\s*(?!({schemes}))\w*:(.+)'
value = re.sub(pattern, '[\\1]: \\3', value, flags=re.IGNORECASE)
# Render Markdown