From 6df0597c5e7f8980dd31c7b52c5308d642050f3b Mon Sep 17 00:00:00 2001 From: Tobias Kunze Date: Tue, 24 Apr 2018 16:22:53 +0200 Subject: [PATCH] Fix #881 -- Allow tel: links in markdown (#882) Closes #881 --- src/pretix/base/templatetags/rich_text.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/pretix/base/templatetags/rich_text.py b/src/pretix/base/templatetags/rich_text.py index 1057d74ce8..682ce0cb3a 100644 --- a/src/pretix/base/templatetags/rich_text.py +++ b/src/pretix/base/templatetags/rich_text.py @@ -58,6 +58,8 @@ ALLOWED_ATTRIBUTES = { # Update doc/user/markdown.rst if you change this! } +ALLOWED_PROTOCOLS = ['http', 'https', 'mailto', 'tel'] + def safelink_callback(attrs, new=False): url = attrs.get((None, 'href'), '/') @@ -86,7 +88,8 @@ def markdown_compile(source): ] ), tags=ALLOWED_TAGS, - attributes=ALLOWED_ATTRIBUTES + attributes=ALLOWED_ATTRIBUTES, + protocols=ALLOWED_PROTOCOLS, )