mirror of https://github.com/zulip/zulip.git
Simplify FencedBlockPreprocessor.format_fence().
(imported from commit 741f4f0640756d545019b6fe6850af3198b351ba)
This commit is contained in:
parent
c0f312ec29
commit
46838ec6d0
|
@ -140,13 +140,14 @@ class FencedBlockPreprocessor(markdown.preprocessors.Preprocessor):
|
||||||
langclass = ''
|
langclass = ''
|
||||||
if lang:
|
if lang:
|
||||||
langclass = LANG_TAG % (lang,)
|
langclass = LANG_TAG % (lang,)
|
||||||
if lang in ('quote', 'quoted'):
|
|
||||||
replacement = self.format_quote(text)
|
|
||||||
return replacement
|
|
||||||
|
|
||||||
code = self.format_code(langclass, lang, text)
|
if lang in ('quote', 'quoted'):
|
||||||
placeholder = self.markdown.htmlStash.store(code, safe=True)
|
replacement = self.format_quote(text)
|
||||||
return placeholder
|
return replacement
|
||||||
|
else:
|
||||||
|
code = self.format_code(langclass, lang, text)
|
||||||
|
placeholder = self.markdown.htmlStash.store(code, safe=True)
|
||||||
|
return placeholder
|
||||||
|
|
||||||
def process_fence(self, m, text):
|
def process_fence(self, m, text):
|
||||||
lang = m.group('lang')
|
lang = m.group('lang')
|
||||||
|
|
Loading…
Reference in New Issue