Don't put any HTML in plain raw pages

pull/69/head v1.1.3
Thomas Buckley-Houston 2018-06-23 19:42:51 +08:00
rodzic f89ecc6e5e
commit 5ddba85a0d
1 zmienionych plików z 9 dodań i 2 usunięć

Wyświetl plik

@ -27,7 +27,6 @@ export default (MixinBase) => class extends MixinBase {
}
_serialiseRawText() {
let info = '';
let raw_text = '';
this._previous_cell_href = '';
this._is_inside_anchor = false;
@ -41,13 +40,21 @@ export default (MixinBase) => class extends MixinBase {
}
raw_text += "\n";
}
if (this._raw_mode_type === 'raw_text_html') {
raw_text = this._wrapHTML(raw_text);
}
return raw_text;
}
_wrapHTML(raw_text) {
let info = '';
const head = this._getHTMLHead();
const date_time = this._getCurrentDataTime();
info += "\n\n" + `Built by <a href="https://www.brow.sh">Browsh</a> on ${date_time}`;
if (this.dimensions.is_page_truncated) {
info += '\nBrowsh parser: the page was too large, some text may have been truncated.';
}
const foot = `${info}</pre></body></html>`
const foot = `${info}</pre></body></html>`;
return head + raw_text + foot;
}