mirror of
https://github.com/zulip/zulip.git
synced 2025-11-10 17:07:07 +00:00
markdown: Keep only 'text' for a no-op pygments rendering.
Previously, we added support for 'none', 'plain' and 'noop' and a function `lang = remap_language(lang)`. This also had the potential to encourage adding more remappings- something that we deliberatly want to keep to a minimum. For context, Anders K doesn't want us to keep any remapping (only keeping 'text' which is the default no-op lexer that pygments has) and Tim wants to keep 'plain' and 'text'. We should only document and advertise 'text'.
This commit is contained in:
committed by
Tim Abbott
parent
2b59590e1f
commit
087b54aa45
@@ -166,11 +166,6 @@ def generic_handler(processor: Any, output: MutableSequence[str],
|
||||
else:
|
||||
return CodeHandler(processor, output, fence, lang, run_content_validators)
|
||||
|
||||
def remap_language(lang: str) -> str:
|
||||
if lang in ['none', 'noop', 'text', 'plain']:
|
||||
return ''
|
||||
return lang
|
||||
|
||||
def check_for_new_fence(processor: Any, output: MutableSequence[str], line: str,
|
||||
run_content_validators: Optional[bool]=False,
|
||||
default_language: Optional[str]=None) -> None:
|
||||
@@ -180,7 +175,6 @@ def check_for_new_fence(processor: Any, output: MutableSequence[str], line: str,
|
||||
lang = m.group('lang')
|
||||
if not lang and default_language:
|
||||
lang = default_language
|
||||
lang = remap_language(lang)
|
||||
handler = generic_handler(processor, output, fence, lang, run_content_validators, default_language)
|
||||
processor.push(handler)
|
||||
else:
|
||||
|
||||
Reference in New Issue
Block a user