diff --git a/zerver/lib/markdown/fenced_code.py b/zerver/lib/markdown/fenced_code.py index b1b1c76273..6e3f3cfb8c 100644 --- a/zerver/lib/markdown/fenced_code.py +++ b/zerver/lib/markdown/fenced_code.py @@ -409,7 +409,7 @@ class FencedBlockPreprocessor(markdown.preprocessors.Preprocessor): lexer_subclass_name = get_lexer_by_name(lang).name except ClassNotFound: lexer_subclass_name = lang - div_tag.attrib['data-codehilite-language'] = lexer_subclass_name + div_tag.attrib['data-code-language'] = lexer_subclass_name # Lxml implicitly converts tags like into # specifying method="c14n" when converting to string, prevents that. code = etree.tostring(div_tag, method="c14n").decode() diff --git a/zerver/tests/fixtures/markdown_test_cases.json b/zerver/tests/fixtures/markdown_test_cases.json index 8a8cb5c2e6..455b8b0514 100644 --- a/zerver/tests/fixtures/markdown_test_cases.json +++ b/zerver/tests/fixtures/markdown_test_cases.json @@ -3,7 +3,7 @@ { "name": "codeblock_hilite", "input": "Hamlet said:\n~~~~.python \ndef speak(self):\n x = 1\n~~~~", - "expected_output": "

Hamlet said:

\n
def speak(self):\n    x = 1\n
", + "expected_output": "

Hamlet said:

\n
def speak(self):\n    x = 1\n
", "marked_expected_output": "

Hamlet said:

\n
def speak(self):\n    x = 1\n
", "text_content": "Hamlet said:\ndef speak(self):\n x = 1\n" }, @@ -786,13 +786,13 @@ { "name": "tex_fenced_tex", "input": "```tex\n\n\\pi \\textbf{ is not } 3.14\n```", - "expected_output": "
\\pi \\textbf{ is not } 3.14\n
", + "expected_output": "
\\pi \\textbf{ is not } 3.14\n
", "marked_expected_output": "
\\pi \\textbf{ is not } 3.14\n
" }, { "name": "tex_fenced_latex", "input": "```latex\n\n\\pi \\textbf{ is not } 3.14\n```", - "expected_output": "
\\pi \\textbf{ is not } 3.14\n
", + "expected_output": "
\\pi \\textbf{ is not } 3.14\n
", "marked_expected_output": "
\\pi \\textbf{ is not } 3.14\n
" }, {