Skip to content
Snippets Groups Projects
Unverified Commit be8346f8 authored by Fredrik Jonsson's avatar Fredrik Jonsson Committed by GitHub
Browse files

Merge pull request #804 from OpenTechFund/bugfix/regex-submission-tags-entities

Make the regex for submission links skip html codes.
parents dca07858 f0407661
No related branches found
No related tags found
No related merge requests found
...@@ -11,7 +11,7 @@ register = template.Library() ...@@ -11,7 +11,7 @@ register = template.Library()
@register.filter @register.filter
def submission_links(value): def submission_links(value):
# Match tags in the format #123 that is not preceeded and/or followed by a word character. # Match tags in the format #123 that is not preceeded and/or followed by a word character.
matches = re.findall('(?<!\w)\#(\d+)(?!\w)', value) matches = re.findall('(?<![\w\&])\#(\d+)(?!\w)', value)
links = {} links = {}
if matches: if matches:
for submission in ApplicationSubmission.objects.filter(id__in=matches): for submission in ApplicationSubmission.objects.filter(id__in=matches):
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment