mirror of
https://github.com/zulip/zulip.git
synced 2025-11-10 17:07:07 +00:00
bugdown: Add 'none' as alias for no syntax highlighting in codeblocks.
This is a precursor to #14404.
This commit is contained in:
committed by
Tim Abbott
parent
326b0e0378
commit
3f6541b306
@@ -165,6 +165,11 @@ 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) -> None:
|
||||
m = FENCE_RE.match(line)
|
||||
@@ -172,6 +177,8 @@ def check_for_new_fence(processor: Any, output: MutableSequence[str], line: str,
|
||||
fence = m.group('fence')
|
||||
lang = m.group('lang')
|
||||
|
||||
lang = remap_language(lang)
|
||||
|
||||
handler = generic_handler(processor, output, fence, lang, run_content_validators)
|
||||
processor.push(handler)
|
||||
else:
|
||||
|
||||
Reference in New Issue
Block a user