From 63f6d10aa947ca25f151fc10a4dfe2fd1d322fbe Mon Sep 17 00:00:00 2001 From: zPlus Date: Fri, 8 Feb 2019 20:35:54 +0100 Subject: [PATCH] Fix #82 Whitelist

tags in markdown->html conversion. --- freepost/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/freepost/__init__.py b/freepost/__init__.py index aef00985..ba8b3ff3 100755 --- a/freepost/__init__.py +++ b/freepost/__init__.py @@ -64,7 +64,7 @@ template = functools.partial ( # "bleach" library is used to sanitize the HTML output of jinja2's "md2html" # filter. The library has only a very restrictive list of white-listed # tags, so we add some more here. -bleach.sanitizer.ALLOWED_TAGS += [ 'br', 'img', 'p', 'pre' ] +bleach.sanitizer.ALLOWED_TAGS += [ 'br', 'img', 'p', 'pre', 'h1', 'h2', 'h3' ] bleach.sanitizer.ALLOWED_ATTRIBUTES.update ({ 'img': [ 'src' ] })