From 92764465e0f41b20184841247853f77717029608 Mon Sep 17 00:00:00 2001 From: rubenwardy Date: Sun, 28 Feb 2021 21:24:52 +0000 Subject: [PATCH] Disable code highlighting for non-annotated code fences Fixes #279 --- app/__init__.py | 2 +- app/utils/markdown.py | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/app/__init__.py b/app/__init__.py index 0027e4e5..afa61bcb 100644 --- a/app/__init__.py +++ b/app/__init__.py @@ -34,7 +34,7 @@ app.config["FLATPAGES_EXTENSION_CONFIG"] = { "fenced_code": {}, "tables": {}, "codehilite": { - "linenums": "True" + "guess_lang": False, } } app.config.from_pyfile(os.environ["FLASK_CONFIG"]) diff --git a/app/utils/markdown.py b/app/utils/markdown.py index bdf225d5..b8b8d060 100644 --- a/app/utils/markdown.py +++ b/app/utils/markdown.py @@ -71,7 +71,9 @@ def render_markdown(source): def init_app(app): global md - md = Markdown(extensions=app.config["FLATPAGES_MARKDOWN_EXTENSIONS"], output_format="html5") + md = Markdown(extensions=app.config["FLATPAGES_MARKDOWN_EXTENSIONS"], + extension_configs=app.config["FLATPAGES_EXTENSION_CONFIG"], + output_format="html5") @app.template_filter() def markdown(source):