From c3fc14c4f19c0404f8b882ee91c7338fe09a0205 Mon Sep 17 00:00:00 2001 From: Glandos Date: Tue, 19 Jun 2018 22:43:07 +0200 Subject: [PATCH] Call reset() if already initialized. This also include a workaround for a waiting-to-be-merged bug in python-markdown. --- sigal/utils.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/sigal/utils.py b/sigal/utils.py index 6c1d06a..642641d 100644 --- a/sigal/utils.py +++ b/sigal/utils.py @@ -81,6 +81,12 @@ def read_markdown(filename): MD = Markdown(extensions=['markdown.extensions.meta', 'markdown.extensions.tables'], output_format='html5') + else: + MD.reset() + # When https://github.com/Python-Markdown/markdown/pull/672 + # will be available, this can be removed. + MD.Meta = {} + # Mark HTML with Markup to prevent jinja2 autoescaping output = {'description': Markup(MD.convert(text))}