Move langclass var into FencedBlockPreprocessor.format_code().

(imported from commit e468a8b6a12494facb0dfa97eff90e02cd14f169)
This commit is contained in:
Steve Howell 2013-11-20 13:48:44 -05:00
parent 46838ec6d0
commit b3344c2f49
1 changed files with 6 additions and 6 deletions

View File

@ -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