mirror of
https://gitea.mueller.network/extern/django-helpdesk.git
synced 2024-11-22 16:03:19 +01:00
update pattern fix issue multi-line in text can be bypass
This commit is contained in:
parent
c54b89f143
commit
4a2ca815fd
@ -57,8 +57,8 @@ def get_markdown(text):
|
||||
return ""
|
||||
|
||||
schemes = '|'.join(helpdesk_settings.ALLOWED_URL_SCHEMES)
|
||||
pattern = fr'\[(.+)\]\((?!({schemes})).*:(.+)\)'
|
||||
text = re.sub(pattern, '[\\1](\\3)', text, flags=re.IGNORECASE)
|
||||
pattern = fr'([\[\s\S\]]*?)\((?!({schemes})).*:(.+)\)'
|
||||
text = re.sub(pattern, '\\1(\\3)', text, flags=re.IGNORECASE)
|
||||
|
||||
return mark_safe(
|
||||
markdown(
|
||||
|
Loading…
Reference in New Issue
Block a user