From 604fb010d24f97d647e94f0c720da7f372f326e8 Mon Sep 17 00:00:00 2001 From: rubenwardy Date: Tue, 31 Oct 2023 18:46:01 +0000 Subject: [PATCH] Fix codehilite guessing languages --- app/markdown.py | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/app/markdown.py b/app/markdown.py index a0d565e3..9125055c 100644 --- a/app/markdown.py +++ b/app/markdown.py @@ -26,6 +26,7 @@ from jinja2.utils import markupsafe from markdown.extensions import Extension from markdown.inlinepatterns import SimpleTagInlineProcessor from markdown.inlinepatterns import Pattern +from markdown.extensions.codehilite import CodeHiliteExtension from xml.etree import ElementTree # Based on @@ -155,13 +156,10 @@ class MentionExtension(Extension): md.inlinePatterns.register(MentionPattern(self.getConfigs(), md), "mention", 20) -MARKDOWN_EXTENSIONS = ["fenced_code", "tables", "codehilite", "toc", DelInsExtension(), MentionExtension()] +MARKDOWN_EXTENSIONS = ["fenced_code", "tables", CodeHiliteExtension(guess_lang=False), "toc", DelInsExtension(), MentionExtension()] MARKDOWN_EXTENSION_CONFIG = { "fenced_code": {}, - "tables": {}, - "codehilite": { - "guess_lang": False, - } + "tables": {} }