From 9ad105276648fede3329a624b1b4116eb2beeba1 Mon Sep 17 00:00:00 2001 From: cuom1999 Date: Sun, 22 Nov 2020 17:17:42 -0600 Subject: [PATCH] Disable mathoid if URL=False --- judge/jinja2/markdown/math.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/judge/jinja2/markdown/math.py b/judge/jinja2/markdown/math.py index d619d5b..6abced9 100644 --- a/judge/jinja2/markdown/math.py +++ b/judge/jinja2/markdown/math.py @@ -2,6 +2,8 @@ import re import mistune +from django.conf import settings + from judge.utils.mathoid import MathoidMathParser mistune._pre_tags.append('latex') @@ -48,7 +50,7 @@ class MathInlineLexer(mistune.InlineLexer): class MathRenderer(mistune.Renderer): def __init__(self, *args, **kwargs): - if kwargs.pop('math', False): + if kwargs.pop('math', False) and settings.MATHOID_URL != False: self.mathoid = MathoidMathParser(kwargs.pop('math_engine', None) or 'svg') else: self.mathoid = None