From b3344c2f496452c6a22134dd53ab6a0f573ee77c Mon Sep 17 00:00:00 2001 From: Steve Howell Date: Wed, 20 Nov 2013 13:48:44 -0500 Subject: [PATCH] Move langclass var into FencedBlockPreprocessor.format_code(). (imported from commit e468a8b6a12494facb0dfa97eff90e02cd14f169) --- zerver/lib/bugdown/fenced_code.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/zerver/lib/bugdown/fenced_code.py b/zerver/lib/bugdown/fenced_code.py index 274306cbf8..55d98afc31 100644 --- a/zerver/lib/bugdown/fenced_code.py +++ b/zerver/lib/bugdown/fenced_code.py @@ -101,7 +101,11 @@ class FencedBlockPreprocessor(markdown.preprocessors.Preprocessor): self.checked_for_codehilite = False self.codehilite_conf = {} - def format_code(self, langclass, lang, text): + def format_code(self, lang, text): + langclass = '' + if lang: + langclass = LANG_TAG % (lang,) + # Check for code hilite extension if not self.checked_for_codehilite: for ext in self.markdown.registeredExtensions: @@ -137,15 +141,11 @@ class FencedBlockPreprocessor(markdown.preprocessors.Preprocessor): return "\n\n".join(quoted_paragraphs) def format_fence(self, lang, text): - langclass = '' - if lang: - langclass = LANG_TAG % (lang,) - if lang in ('quote', 'quoted'): replacement = self.format_quote(text) return replacement else: - code = self.format_code(langclass, lang, text) + code = self.format_code(lang, text) placeholder = self.markdown.htmlStash.store(code, safe=True) return placeholder