mirror of
https://github.com/zulip/zulip.git
synced 2025-11-09 08:26:11 +00:00
markdown: Organize preprocessor priorities in one place.
All of our custom Markdown extensions have priorities that govern the order in which the preprocessors will be run. It is more convenient to have these all in one file so that you can easily discern the order at first glance. Thanks to Alya Abbott for reporting the bug that led to this refactoring!
This commit is contained in:
@@ -88,6 +88,7 @@ from pygments.lexers import find_lexer_class_by_name
|
||||
from pygments.util import ClassNotFound
|
||||
|
||||
from zerver.lib.exceptions import MarkdownRenderingException
|
||||
from zerver.lib.markdown.preprocessor_priorities import PREPROCESSOR_PRIORITES
|
||||
from zerver.lib.tex import render_tex
|
||||
|
||||
# Global vars
|
||||
@@ -162,7 +163,9 @@ class FencedCodeExtension(Extension):
|
||||
processor = FencedBlockPreprocessor(
|
||||
md, run_content_validators=self.config["run_content_validators"][0]
|
||||
)
|
||||
md.preprocessors.register(processor, "fenced_code_block", 25)
|
||||
md.preprocessors.register(
|
||||
processor, "fenced_code_block", PREPROCESSOR_PRIORITES["fenced_code_block"]
|
||||
)
|
||||
|
||||
|
||||
class ZulipBaseHandler:
|
||||
|
||||
Reference in New Issue
Block a user