From ebd164c74d5e3ffdc874e0b7b419818dc9571e69 Mon Sep 17 00:00:00 2001 From: Lucas Leblanc Date: Tue, 27 Jun 2023 15:25:05 +0200 Subject: [PATCH] Fix: Style for wiki syntax The goal of this PR is to correct the style for wiki syntax when the -comment-syntax:wiki is activate. I have 2 possibilities: First-Change the tag(Done on this PR): So when the correct syntax is called I change the tag to strong,em,etc.. instead of using a span with a class. Second-Change the CSS: We keep the span with a class and we add the correct CSS associated to the class. --- scaladoc/src/dotty/tools/scaladoc/renderers/DocRenderer.scala | 4 ++-- scaladoc/src/dotty/tools/scaladoc/util/html.scala | 2 ++ 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/scaladoc/src/dotty/tools/scaladoc/renderers/DocRenderer.scala b/scaladoc/src/dotty/tools/scaladoc/renderers/DocRenderer.scala index 58898339db5d..1d634ab75dba 100644 --- a/scaladoc/src/dotty/tools/scaladoc/renderers/DocRenderer.scala +++ b/scaladoc/src/dotty/tools/scaladoc/renderers/DocRenderer.scala @@ -79,9 +79,9 @@ class DocRender(signatureRenderer: SignatureRenderer)(using DocContext): case UnorderedList(items) => ul(listItems(items)) case OrderedList(items, style) => ol(listItems(items)) // TODO use style case Chain(items: Seq[Inline]) => span(items.map(renderElement)) - case Italic(text) => span(cls:="italic")(renderElement(text)) + case Italic(text) => em(renderElement(text)) case Underline(text) => span(cls:="underline")(renderElement(text)) - case Bold(text) => span(cls:="bold")(renderElement(text)) + case Bold(text) => strong(renderElement(text)) case Monospace(text) => code(renderElement(text)) case Superscript(text) => span(cls:="superscript")(renderElement(text)) // TODO implement style case Subscript(text) => span(cls:="subscript")(renderElement(text)) // TODO implement style diff --git a/scaladoc/src/dotty/tools/scaladoc/util/html.scala b/scaladoc/src/dotty/tools/scaladoc/util/html.scala index 72776a7413aa..9d832d28ee0b 100644 --- a/scaladoc/src/dotty/tools/scaladoc/util/html.scala +++ b/scaladoc/src/dotty/tools/scaladoc/util/html.scala @@ -51,6 +51,8 @@ object HTML: val div = Tag("div") val span = Tag("span") + val em = Tag("em") + val strong = Tag("strong") val a = Tag("a") val p = Tag("p") val h1 = Tag("h1")