kopia lustrzana https://github.com/browsh-org/browsh
Force monospace for raw text HTML pages
rodzic
2350000cfb
commit
d4cb55f91e
|
@ -41,9 +41,9 @@ export default (MixinBase) => class extends MixinBase {
|
|||
}
|
||||
raw_text += "\n";
|
||||
}
|
||||
const head = `<html><title>${document.title}</title><body><pre>`
|
||||
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}`
|
||||
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.';
|
||||
}
|
||||
|
@ -51,6 +51,20 @@ export default (MixinBase) => class extends MixinBase {
|
|||
return head + raw_text + foot;
|
||||
}
|
||||
|
||||
_getHTMLHead() {
|
||||
return `<html>
|
||||
<head>
|
||||
<title>${document.title}</title>
|
||||
<style>
|
||||
html * {
|
||||
font-family: monospace;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<pre>`;
|
||||
}
|
||||
|
||||
_getCurrentDataTime() {
|
||||
let current_date = new Date();
|
||||
const offset = -(new Date().getTimezoneOffset() / 60);
|
||||
|
|
Ładowanie…
Reference in New Issue