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:
Rohitt Vashishtha 2020-04-14 03:23:46 +00:00 committed by Tim Abbott
parent 2b59590e1f
commit 087b54aa45
2 changed files with 1 additions and 9 deletions

View File

@ -31,7 +31,6 @@
"matlab": 33,
"mql": 9,
"mql4": 9,
"none": 1,
"objective-c": 35,
"objectivec": 35,
"objectpascal": 42,
@ -39,7 +38,6 @@
"perl": 40,
"php": 44,
"pl": 40,
"plain": 1,
"prolog": 16,
"python": 46,
"quote": 50,
@ -47,13 +45,13 @@
"rb": 39,
"ruby": 39,
"rust": 8,
"text": 1,
"sas": 30,
"scala": 21,
"scheme": 14,
"sql": 32,
"swift": 41,
"tex": 40,
"text": 1,
"vb.net": 45,
"vbnet": 45,
"xml": 1

View File

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