diff --git a/public/index.html b/public/index.html index fb7f6e1..92b878d 100644 --- a/public/index.html +++ b/public/index.html @@ -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 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*)/) === null) + .join('\n'); window.tokens = tokenize(normalizeNewlines(text)); window.spans = highlight(tokens); diff --git a/public/xhr.html b/public/xhr.html index f611ef3..65947f1 100644 --- a/public/xhr.html +++ b/public/xhr.html @@ -101,7 +101,13 @@ const request = new XMLHttpRequest(); request.addEventListener("load", async function() { - const text = this.responseText; + const text = this.responseText + // NOTE: This removes 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*)/) === null) + .join('\n'); window.tokens = tokenize(normalizeNewlines(text)); window.spans = highlight(tokens);