From f0407661656b43292a4cc6a029f7fc0a989b399b Mon Sep 17 00:00:00 2001 From: Fredrik Jonsson <frjo@xdeb.org> Date: Tue, 8 Jan 2019 11:45:55 +0100 Subject: [PATCH] Make the regex for submission links skip html codes. --- opentech/apply/funds/templatetags/submission_tags.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/opentech/apply/funds/templatetags/submission_tags.py b/opentech/apply/funds/templatetags/submission_tags.py index a55bc257b..acfdf0b15 100644 --- a/opentech/apply/funds/templatetags/submission_tags.py +++ b/opentech/apply/funds/templatetags/submission_tags.py @@ -11,7 +11,7 @@ register = template.Library() @register.filter def submission_links(value): # 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 = {} if matches: for submission in ApplicationSubmission.objects.filter(id__in=matches): -- GitLab