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:
Tim Abbott
2014-02-07 16:05:19 -05:00
parent 72ee636571
commit 4891da83ad
2 changed files with 9 additions and 4 deletions

View File

@@ -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():
del md.preprocessors[k] if k not in ["custom_text_notifications"]:
for k in md.postprocessors.keys(): del md.preprocessors[k]
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]

View File

@@ -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>',
)