Skip to content

Commit 0625d1c

Browse files
authored
Fix: Add Doctype to be in standard mode (#17087)
In this PR, I added the `<!DOCTYPE html>` in the HtmlRenderer file. I combined in the def page content the tag html with all the content of the page (head, body,...) and the Doctype. ## Result : <img width="400" alt="Screenshot 2023-03-13 at 16 03 43" src="https://user-images.githubusercontent.com/44496264/224742326-280b1f86-e578-4f25-8d13-9ca39f6c0aec.png"> (On chrome) <img width="400" alt="Screenshot 2023-03-13 at 16 04 36" src="https://user-images.githubusercontent.com/44496264/224742405-c5dbc809-c085-4cde-aa4d-4faffc088682.png"> Fixes #16803
1 parent dcf5f9d commit 0625d1c

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

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

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,14 +41,18 @@ class HtmlRenderer(rootPackage: Member, members: Map[DRI, Member])(using ctx: Do
4141
case _ => Nil)
4242
:+ (Attr("data-pathToRoot") := pathToRoot(page.link.dri))
4343

44-
html(attrs: _*)(
44+
val htmlTag = html(attrs: _*)(
4545
head((mkHead(page) :+ docHead):_*),
4646
body(
4747
if !page.hasFrame then docBody
4848
else mkFrame(page.link, parents, docBody, toc)
4949
)
5050
)
5151

52+
val doctypeTag = s"<!DOCTYPE html>"
53+
val finalTag = raw(doctypeTag + htmlTag.toString)
54+
finalTag
55+
5256
override def render(): Unit =
5357
val renderedResources = renderResources()
5458
super.render()

0 commit comments

Comments
 (0)