From ca7ccab64465586ea3334a0de2843dba511a9657 Mon Sep 17 00:00:00 2001 From: Kacper Korban Date: Tue, 20 Jul 2021 18:45:34 +0200 Subject: [PATCH] Escape illegal characters in scaladoc code blocks Fixes #13107 --- scaladoc/src/dotty/tools/scaladoc/renderers/DocRenderer.scala | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scaladoc/src/dotty/tools/scaladoc/renderers/DocRenderer.scala b/scaladoc/src/dotty/tools/scaladoc/renderers/DocRenderer.scala index 6f52abb0a61b..76d88a8a0bb3 100644 --- a/scaladoc/src/dotty/tools/scaladoc/renderers/DocRenderer.scala +++ b/scaladoc/src/dotty/tools/scaladoc/renderers/DocRenderer.scala @@ -46,7 +46,7 @@ class DocRender(signatureRenderer: SignatureRenderer)(using DocContext): case 5 => h5(content) case 6 => h6(content) case Paragraph(text) => p(renderElement(text)) - case Code(data: String) => pre(code(raw(data))) // TODO add classes + case Code(data: String) => pre(code(raw(data.escapeReservedTokens))) // TODO add classes case HorizontalRule => hr case UnorderedList(items) => ul(listItems(items))