mirror of
https://github.com/zulip/zulip.git
synced 2025-11-11 09:27:43 +00:00
Fix autolinkification in Zephyr mirrored content.
Apparently the "inline" treeprocessor is what runs the inline patterns. Also re-enable the rewriting-to-https support. (imported from commit 2fde2c1f15217a784f26b16db25ee745f424f2f0)
This commit is contained in:
@@ -902,12 +902,11 @@ class Bugdown(markdown.Extension):
|
|||||||
if k not in ["autolink"]:
|
if k not in ["autolink"]:
|
||||||
del md.inlinePatterns[k]
|
del md.inlinePatterns[k]
|
||||||
for k in md.treeprocessors.keys():
|
for k in md.treeprocessors.keys():
|
||||||
if k not in ["inline_interesting_links"]:
|
if k not in ["inline_interesting_links", "inline", "rewrite_to_https"]:
|
||||||
del md.treeprocessors[k]
|
del md.treeprocessors[k]
|
||||||
for k in md.preprocessors.keys():
|
for k in md.preprocessors.keys():
|
||||||
|
if k not in ["custom_text_notifications"]:
|
||||||
del md.preprocessors[k]
|
del md.preprocessors[k]
|
||||||
for k in md.postprocessors.keys():
|
|
||||||
del md.postprocessors[k]
|
|
||||||
for k in md.parser.blockprocessors.keys():
|
for k in md.parser.blockprocessors.keys():
|
||||||
if k not in ["paragraph"]:
|
if k not in ["paragraph"]:
|
||||||
del md.parser.blockprocessors[k]
|
del md.parser.blockprocessors[k]
|
||||||
|
|||||||
@@ -386,4 +386,10 @@ class BugdownTest(TestCase):
|
|||||||
converted,
|
converted,
|
||||||
"<p>* test</p>",
|
"<p>* test</p>",
|
||||||
)
|
)
|
||||||
|
msg = "https://lists.debian.org/debian-ctte/2014/02/msg00173.html"
|
||||||
|
converted = bugdown.convert(msg, "mit.edu/zephyr_mirror")
|
||||||
|
self.assertEqual(
|
||||||
|
converted,
|
||||||
|
'<p><a href="https://lists.debian.org/debian-ctte/2014/02/msg00173.html" target="_blank" title="https://lists.debian.org/debian-ctte/2014/02/msg00173.html">https://lists.debian.org/debian-ctte/2014/02/msg00173.html</a></p>',
|
||||||
|
)
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user