diff --git a/modules/markup/jupyter/jupyter.go b/modules/markup/jupyter/jupyter.go index a02eb4a0287..8acaf64d0d1 100644 --- a/modules/markup/jupyter/jupyter.go +++ b/modules/markup/jupyter/jupyter.go @@ -215,7 +215,7 @@ func renderCellCode(output htmlutil.HTMLWriter, cell Cell, language string) erro // Highlight code lexer := highlight.DetectChromaLexerByFileName("", language) - output.WriteFormat(`
`, strings.ToLower(language))
+ output.WriteFormat(``, strings.ToLower(lexer.Config().Name))
output.WriteHTML(highlight.RenderCodeByLexer(lexer, source))
output.WriteHTML("
")
}
diff --git a/modules/markup/jupyter/jupyter_test.go b/modules/markup/jupyter/jupyter_test.go
index 61d362da987..bdea55308cf 100644
--- a/modules/markup/jupyter/jupyter_test.go
+++ b/modules/markup/jupyter/jupyter_test.go
@@ -261,7 +261,7 @@ func TestIntegrationAndSanitization(t *testing.T) {
maliciousNotebook := `{
"nbformat": 4,
"nbformat_minor": 2,
- "metadata": {},
+ "metadata": {"language_info":{"name":"any lang"}},
"cells": [
{
"cell_type": "code",
@@ -295,8 +295,8 @@ func TestIntegrationAndSanitization(t *testing.T) {
In [1]:
-
- a=1
+
+ a=1