From 287aae8bd2df5aabe2d5e00c91bb15155d7d2076 Mon Sep 17 00:00:00 2001 From: rubenwardy Date: Fri, 19 May 2023 20:36:51 +0100 Subject: [PATCH] Disable linkify on tags --- app/markdown.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/app/markdown.py b/app/markdown.py index 0d5271a8..68152068 100644 --- a/app/markdown.py +++ b/app/markdown.py @@ -79,7 +79,9 @@ def render_markdown(source): tags=ALLOWED_TAGS, attributes=ALLOWED_ATTRIBUTES, protocols=ALLOWED_PROTOCOLS, - filters=[partial(LinkifyFilter, callbacks=[linker_callback] + bleach.linkifier.DEFAULT_CALLBACKS, skip_tags={"pre"})]) + filters=[partial(LinkifyFilter, + callbacks=[linker_callback] + bleach.linkifier.DEFAULT_CALLBACKS, + skip_tags={"pre", "code"})]) return cleaner.clean(html)