For HTML output, create a full .html file

This adds the necessary code to get the .html file to pass
http://validator.w3.org/check

This adds DOCTYPE/head/body/etc.

Note that the validator fails if there are & in the output.

CCMAIL: von.kde.org@martin-ueding.de
(cherry picked from commit 0ec29537dd)
wilder-portage
Kurt Hindenburg 13 years ago
parent b94acfce50
commit a4aa495c75
  1. 15
      src/TerminalCharacterDecoder.cpp

@ -150,6 +150,16 @@ void HTMLDecoder::begin(QTextStream* output)
QString text;
text.append("<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Strict//EN\"\n");
text.append("\"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd\">\n");
text.append("<html xmlns=\"http://www.w3.org/1999/xhtml\" lang=\"en\" xml:lang=\"en\">\n");
text.append("<head>\n");
text.append("<title>Konsole output</title>\n");
text.append("<meta http-equiv=\"Content-Type\" content=\"text/html;charset=utf-8\" />\n");
text.append("</head>\n");
text.append("<body>\n");
text.append("<div>\n");
//open monospace span
openSpan(text, "font-family:monospace");
@ -163,6 +173,9 @@ void HTMLDecoder::end()
QString text;
closeSpan(text);
text.append("</div>\n");
text.append("</body>\n");
text.append("</html>\n");
*_output << text;
@ -257,7 +270,7 @@ void HTMLDecoder::decodeLine(const Character* const characters, int count, LineP
}
//start new line
text.append("<br>");
text.append("<br />");
*_output << text;
}

Loading…
Cancel
Save