From 249fdad1bc61bdd0a5f97920129f53033e8be15b Mon Sep 17 00:00:00 2001 From: Mattia Succurro Date: Tue, 7 Jun 2022 17:56:06 +0200 Subject: [PATCH] Add opt out from math in query string --- app.py | 4 ++-- templates/view.html | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/app.py b/app.py index d77130e..591c97b 100644 --- a/app.py +++ b/app.py @@ -237,8 +237,8 @@ class PageRevision(BaseModel): @property def text(self): return self.textref.get_content() - def html(self): - return md(self.text, math=self.page.is_math_enabled) + def html(self, *, math=True): + return md(self.text, math=self.page.is_math_enabled and math) def human_pub_date(self): delta = datetime.datetime.now() - self.pub_date T = partial(get_string, g.lang) diff --git a/templates/view.html b/templates/view.html index 18958fd..262c161 100644 --- a/templates/view.html +++ b/templates/view.html @@ -16,7 +16,7 @@ {% block history_nav %}{% endblock %}
- {{ rev.html()|safe }} + {{ rev.html(math = request.args.get('math') not in ['0', 'false', 'no', 'off'])|safe }}
{% if p.tags %}