Public: Hide <link rel="me"> head tags from appearing in the source
This patch adds some dirty line iteration and regexes to remove <link> tags from the documents that would clutter the head section of the document and as such make content harder to read.
This commit is contained in:
parent
8ed993d7d2
commit
d5ef5aa149
2 changed files with 14 additions and 2 deletions
|
@ -100,7 +100,13 @@
|
|||
import { Inspector } from '/script/html/inspector.js';
|
||||
|
||||
const response = await fetch(window.location.href);
|
||||
const text = await response.text();
|
||||
const text = (await response.text())
|
||||
// NOTE: This removes <link rel="me" href="some-ressource"> tags from the document so the head
|
||||
// doesn't get as cluttered.
|
||||
// FIXME: Change this to use a more sophisticated api once tree construction is implemented.
|
||||
.split('\n')
|
||||
.filter(line => line.match(/^(?:\s*)<link rel="me" href="(.*)">/) === null)
|
||||
.join('\n');
|
||||
|
||||
window.tokens = tokenize(normalizeNewlines(text));
|
||||
window.spans = highlight(tokens);
|
||||
|
|
|
@ -101,7 +101,13 @@
|
|||
|
||||
const request = new XMLHttpRequest();
|
||||
request.addEventListener("load", async function() {
|
||||
const text = this.responseText;
|
||||
const text = this.responseText
|
||||
// NOTE: This removes <link rel="me" href="some-ressource"> tags from the document so the head
|
||||
// doesn't get as cluttered.
|
||||
// FIXME: Change this to use a more sophisticated api once tree construction is implemented.
|
||||
.split('\n')
|
||||
.filter(line => line.match(/^(?:\s*)<link rel="me" href="(.*)">/) === null)
|
||||
.join('\n');
|
||||
|
||||
window.tokens = tokenize(normalizeNewlines(text));
|
||||
window.spans = highlight(tokens);
|
||||
|
|
Loading…
Reference in a new issue