summaryrefslogtreecommitdiff
path: root/src/scaladoc/scala/tools/nsc/doc/html/HtmlPage.scala
diff options
context:
space:
mode:
authorSimon Ochsenreither <simon@ochsenreither.de>2013-05-15 01:06:50 +0200
committerSimon Ochsenreither <simon@ochsenreither.de>2013-06-09 00:36:36 +0200
commitc77edc44c2da1249fd4d61347e9013c969125571 (patch)
tree93344f384a1e509513d5a38d72c486e175df9f71 /src/scaladoc/scala/tools/nsc/doc/html/HtmlPage.scala
parent20f8eacca4f4b0bbc2c5f9045a87f8b003ba8876 (diff)
downloadscala-c77edc44c2da1249fd4d61347e9013c969125571.tar.gz
scala-c77edc44c2da1249fd4d61347e9013c969125571.tar.bz2
scala-c77edc44c2da1249fd4d61347e9013c969125571.zip
SI-6503 Fix scaladoc output to generate valid HTML5
I checked the generated HTML with the validators provided by http://validator.w3.org/ and http://html5.validator.nu/ to verify that all issues have been fixed. Changes: - Adapt doctype - Remove processing instructions - Add alt attributes to image tags Before that, the output tried to be XHTML 1.1, but failed validation as attested by both validators mentioned above, making it more likely to trigger the quirks modes in browsers.
Diffstat (limited to 'src/scaladoc/scala/tools/nsc/doc/html/HtmlPage.scala')
-rw-r--r--src/scaladoc/scala/tools/nsc/doc/html/HtmlPage.scala6
1 files changed, 1 insertions, 5 deletions
diff --git a/src/scaladoc/scala/tools/nsc/doc/html/HtmlPage.scala b/src/scaladoc/scala/tools/nsc/doc/html/HtmlPage.scala
index 159e16375c..f6373e9e97 100644
--- a/src/scaladoc/scala/tools/nsc/doc/html/HtmlPage.scala
+++ b/src/scaladoc/scala/tools/nsc/doc/html/HtmlPage.scala
@@ -42,8 +42,7 @@ abstract class HtmlPage extends Page { thisPage =>
def body: NodeSeq
def writeFor(site: HtmlFactory) {
- val doctype =
- DocType("html", PublicID("-//W3C//DTD XHTML 1.1//EN", "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd"), Nil)
+ val doctype = DocType("html")
val html =
<html>
<head>
@@ -57,7 +56,6 @@ abstract class HtmlPage extends Page { thisPage =>
</html>
writeFile(site) { (w: Writer) =>
- w.write("<?xml version='1.0' encoding='" + site.encoding + "'?>\n")
w.write(doctype.toString + "\n")
w.write(xml.Xhtml.toXhtml(html))
}
@@ -67,8 +65,6 @@ abstract class HtmlPage extends Page { thisPage =>
// we're only interested in the body, as this will go into the diff
_.write(body.text)
}
-
- //XML.save(pageFile.getPath, html, site.encoding, xmlDecl = false, doctype = doctype)
}
/** Transforms an optional comment into an styled HTML tree representing its body if it is defined, or into an empty