From 4891da83ad078cc12921c77ee825de31a5f99e69 Mon Sep 17 00:00:00 2001 From: Tim Abbott Date: Fri, 7 Feb 2014 16:05:19 -0500 Subject: [PATCH] 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) --- zerver/lib/bugdown/__init__.py | 7 +++---- zerver/test_bugdown.py | 6 ++++++ 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/zerver/lib/bugdown/__init__.py b/zerver/lib/bugdown/__init__.py index f1a9382283..669fa3ae14 100644 --- a/zerver/lib/bugdown/__init__.py +++ b/zerver/lib/bugdown/__init__.py @@ -902,12 +902,11 @@ class Bugdown(markdown.Extension): if k not in ["autolink"]: del md.inlinePatterns[k] 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] for k in md.preprocessors.keys(): - del md.preprocessors[k] - for k in md.postprocessors.keys(): - del md.postprocessors[k] + if k not in ["custom_text_notifications"]: + del md.preprocessors[k] for k in md.parser.blockprocessors.keys(): if k not in ["paragraph"]: del md.parser.blockprocessors[k] diff --git a/zerver/test_bugdown.py b/zerver/test_bugdown.py index ee1299e6aa..ba290187ff 100644 --- a/zerver/test_bugdown.py +++ b/zerver/test_bugdown.py @@ -386,4 +386,10 @@ class BugdownTest(TestCase): converted, "

* test

", ) + msg = "https://lists.debian.org/debian-ctte/2014/02/msg00173.html" + converted = bugdown.convert(msg, "mit.edu/zephyr_mirror") + self.assertEqual( + converted, + '

https://lists.debian.org/debian-ctte/2014/02/msg00173.html

', + )