Skip to content

Commit afe463f

Browse files
authored
Fix: Style for wiki syntax (#18079)
The purpose of this PR is to correct the style of wiki syntax when the -comment-syntax:wiki option is enabled. There are 2 possibilities: - First, change the tag (done in this PR): So when the correct syntax is called up, 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 add the correct CSS associated with the class. ### Code: <img width="399" alt="Screenshot 2023-06-27 at 16 01 31" src="https://github.com/lampepfl/dotty/assets/44496264/e75ba21f-03f5-40b2-8ce5-4356e9b933f4"> ### Before: <img width="1920" alt="Screenshot 2023-06-27 at 16 03 30" src="https://github.com/lampepfl/dotty/assets/44496264/958bd703-4570-402a-808c-5700a0a203fe"> ### After: <img width="1920" alt="Screenshot 2023-06-27 at 16 01 34" src="https://github.com/lampepfl/dotty/assets/44496264/35a3facb-1538-4fe0-b6ed-1bcda0e8f534"> Fix: #18051
2 parents 588a0b1 + ebd164c commit afe463f

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

scaladoc/src/dotty/tools/scaladoc/renderers/DocRenderer.scala

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -79,9 +79,9 @@ class DocRender(signatureRenderer: SignatureRenderer)(using DocContext):
7979
case UnorderedList(items) => ul(listItems(items))
8080
case OrderedList(items, style) => ol(listItems(items)) // TODO use style
8181
case Chain(items: Seq[Inline]) => span(items.map(renderElement))
82-
case Italic(text) => span(cls:="italic")(renderElement(text))
82+
case Italic(text) => em(renderElement(text))
8383
case Underline(text) => span(cls:="underline")(renderElement(text))
84-
case Bold(text) => span(cls:="bold")(renderElement(text))
84+
case Bold(text) => strong(renderElement(text))
8585
case Monospace(text) => code(renderElement(text))
8686
case Superscript(text) => span(cls:="superscript")(renderElement(text)) // TODO implement style
8787
case Subscript(text) => span(cls:="subscript")(renderElement(text)) // TODO implement style

scaladoc/src/dotty/tools/scaladoc/util/html.scala

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,8 @@ object HTML:
5151

5252
val div = Tag("div")
5353
val span = Tag("span")
54+
val em = Tag("em")
55+
val strong = Tag("strong")
5456
val a = Tag("a")
5557
val p = Tag("p")
5658
val h1 = Tag("h1")

0 commit comments

Comments
 (0)