mirror of https://github.com/zulip/zulip.git
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:
parent
2b59590e1f
commit
087b54aa45
|
@ -31,7 +31,6 @@
|
||||||
"matlab": 33,
|
"matlab": 33,
|
||||||
"mql": 9,
|
"mql": 9,
|
||||||
"mql4": 9,
|
"mql4": 9,
|
||||||
"none": 1,
|
|
||||||
"objective-c": 35,
|
"objective-c": 35,
|
||||||
"objectivec": 35,
|
"objectivec": 35,
|
||||||
"objectpascal": 42,
|
"objectpascal": 42,
|
||||||
|
@ -39,7 +38,6 @@
|
||||||
"perl": 40,
|
"perl": 40,
|
||||||
"php": 44,
|
"php": 44,
|
||||||
"pl": 40,
|
"pl": 40,
|
||||||
"plain": 1,
|
|
||||||
"prolog": 16,
|
"prolog": 16,
|
||||||
"python": 46,
|
"python": 46,
|
||||||
"quote": 50,
|
"quote": 50,
|
||||||
|
@ -47,13 +45,13 @@
|
||||||
"rb": 39,
|
"rb": 39,
|
||||||
"ruby": 39,
|
"ruby": 39,
|
||||||
"rust": 8,
|
"rust": 8,
|
||||||
"text": 1,
|
|
||||||
"sas": 30,
|
"sas": 30,
|
||||||
"scala": 21,
|
"scala": 21,
|
||||||
"scheme": 14,
|
"scheme": 14,
|
||||||
"sql": 32,
|
"sql": 32,
|
||||||
"swift": 41,
|
"swift": 41,
|
||||||
"tex": 40,
|
"tex": 40,
|
||||||
|
"text": 1,
|
||||||
"vb.net": 45,
|
"vb.net": 45,
|
||||||
"vbnet": 45,
|
"vbnet": 45,
|
||||||
"xml": 1
|
"xml": 1
|
||||||
|
|
|
@ -166,11 +166,6 @@ def generic_handler(processor: Any, output: MutableSequence[str],
|
||||||
else:
|
else:
|
||||||
return CodeHandler(processor, output, fence, lang, run_content_validators)
|
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,
|
def check_for_new_fence(processor: Any, output: MutableSequence[str], line: str,
|
||||||
run_content_validators: Optional[bool]=False,
|
run_content_validators: Optional[bool]=False,
|
||||||
default_language: Optional[str]=None) -> None:
|
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')
|
lang = m.group('lang')
|
||||||
if not lang and default_language:
|
if not lang and default_language:
|
||||||
lang = default_language
|
lang = default_language
|
||||||
lang = remap_language(lang)
|
|
||||||
handler = generic_handler(processor, output, fence, lang, run_content_validators, default_language)
|
handler = generic_handler(processor, output, fence, lang, run_content_validators, default_language)
|
||||||
processor.push(handler)
|
processor.push(handler)
|
||||||
else:
|
else:
|
||||||
|
|
Loading…
Reference in New Issue