mirror of
https://github.com/django-helpdesk/django-helpdesk.git
synced 2025-01-19 12:29:34 +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 ""
|
return ""
|
||||||
|
|
||||||
schemes = '|'.join(helpdesk_settings.ALLOWED_URL_SCHEMES)
|
schemes = '|'.join(helpdesk_settings.ALLOWED_URL_SCHEMES)
|
||||||
pattern = fr'\[(.+)\]\((?!({schemes})).*:(.+)\)'
|
pattern = fr'([\[\s\S\]]*?)\((?!({schemes})).*:(.+)\)'
|
||||||
text = re.sub(pattern, '[\\1](\\3)', text, flags=re.IGNORECASE)
|
text = re.sub(pattern, '\\1(\\3)', text, flags=re.IGNORECASE)
|
||||||
|
|
||||||
return mark_safe(
|
return mark_safe(
|
||||||
markdown(
|
markdown(
|
||||||
|
Loading…
Reference in New Issue
Block a user