Skip to content

armgit / zulip

Public Imported from GitHub
0

Zulip server and web application. Open-source team chat that helps teams stay productive and focused.

markdown: Parse included blocks in a new parser state.

Anders Kaseorg869fe60689cb
diff --git a/zerver/lib/markdown/include.py b/zerver/lib/markdown/include.py
index 38df69e1b4f..ec1db3ae786 100644
--- a/zerver/lib/markdown/include.py
+++ b/zerver/lib/markdown/include.py
@@ -47,7 +47,9 @@ class IncludeBlockProcessor(BlockProcessor):
return "\n".join(lines)
def run(self, parent: Element, blocks: List[str]) -> None:
- blocks[:1] = self.RE.sub(self.expand_include, blocks[0]).split("\n\n")
+ self.parser.state.set("include")
+ self.parser.parseChunk(parent, self.RE.sub(self.expand_include, blocks.pop(0)))
+ self.parser.state.reset()
def makeExtension(base_path: str) -> IncludeExtension: