Skip to content

Commit

Permalink
MDL-56629 dataformat_html: Adding UTF-8 charset
Browse files Browse the repository at this point in the history
Also adding the HEAD tag which was missing.

(credit goes to Frédéric Massart - FMCorz, thanks!)
  • Loading branch information
stronk7 authored and danpoltawski committed Jul 11, 2017
1 parent 64ea4b5 commit bdf31b0
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion dataformat/html/classes/writer.php
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down Expand Up @@ -73,6 +74,7 @@ public function start_output() {
margin: auto;
}
</style>
</head>
<body>";
}

Expand Down

0 comments on commit bdf31b0

Please sign in to comment.