From 2955cac47ed972f4aa1347c890c533a9060aacd0 Mon Sep 17 00:00:00 2001 From: Steve Howell Date: Wed, 20 Nov 2013 13:53:03 -0500 Subject: [PATCH] Extract vars in FencedBlockPreprocessor.process_fence(). (imported from commit 092a8e5f7479f1d918219cae058b6a867743c7f9) --- zerver/lib/bugdown/fenced_code.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/zerver/lib/bugdown/fenced_code.py b/zerver/lib/bugdown/fenced_code.py index 55d98afc31..b014d89945 100644 --- a/zerver/lib/bugdown/fenced_code.py +++ b/zerver/lib/bugdown/fenced_code.py @@ -153,7 +153,9 @@ class FencedBlockPreprocessor(markdown.preprocessors.Preprocessor): lang = m.group('lang') code = m.group('code') fence_text = self.format_fence(lang, code) - return '%s\n%s\n%s'% (text[:m.start()], fence_text, text[m.end():]) + before_text = text[:m.start()] + end_text = text[m.end():] + return '%s\n%s\n%s'% (before_text, fence_text, end_text) def run(self, lines): """ Match and store Fenced Code Blocks in the HtmlStash. """