mirror of
https://github.com/zulip/zulip.git
synced 2025-11-04 22:13:26 +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:
@@ -6,6 +6,7 @@ import markdown
|
||||
from markdown_include.include import IncludePreprocessor, MarkdownInclude
|
||||
|
||||
from zerver.lib.exceptions import InvalidMarkdownIncludeStatement
|
||||
from zerver.lib.markdown.preprocessor_priorities import PREPROCESSOR_PRIORITES
|
||||
|
||||
INC_SYNTAX = re.compile(r"\{!\s*(.+?)\s*!\}")
|
||||
|
||||
@@ -15,7 +16,7 @@ class MarkdownIncludeCustom(MarkdownInclude):
|
||||
md.preprocessors.register(
|
||||
IncludeCustomPreprocessor(md, self.getConfigs()),
|
||||
"include_wrapper",
|
||||
500,
|
||||
PREPROCESSOR_PRIORITES["include"],
|
||||
)
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user