MDL-56629 dataformat_html: Adding UTF-8 charset

Also adding the HEAD tag which was missing.

(credit goes to Frédéric Massart - FMCorz, thanks!)
This commit is contained in:
Eloy Lafuente (stronk7)
2017-07-11 13:43:17 +01:00
committed by Dan Poltawski
parent 64ea4b5edd
commit bdf31b0919
+3 -1
View File
@@ -45,7 +45,8 @@ class writer extends \core\dataformat\base {
* Write the start of the output
*/
public function start_output() {
echo "<!DOCTYPE html><html>";
echo "<!DOCTYPE html><html><head>";
echo \html_writer::empty_tag('meta', ['charset' => 'UTF-8']);
echo \html_writer::tag('title', $this->filename);
echo "<style>
html, body {
@@ -73,6 +74,7 @@ table {
margin: auto;
}
</style>
</head>
<body>";
}