From 72ce1e3f007bd659fe41bcff6922ae9d08e19fea Mon Sep 17 00:00:00 2001 From: Nate Weaver Date: Fri, 20 Nov 2020 11:02:30 -0600 Subject: [PATCH] Strip position from style attributes --- Shared/Article Rendering/main.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Shared/Article Rendering/main.js b/Shared/Article Rendering/main.js index 413906197..f0aceebee 100644 --- a/Shared/Article Rendering/main.js +++ b/Shared/Article Rendering/main.js @@ -18,10 +18,11 @@ function stripStylesFromElement(element, propertiesToStrip) { } } +// Strip inline styles that could harm readability. function stripStyles() { document.getElementsByTagName("body")[0].querySelectorAll("style, link[rel=stylesheet]").forEach(element => element.remove()); // Removing "background" and "font" will also remove properties that would be reflected in them, e.g., "background-color" and "font-family" - document.getElementsByTagName("body")[0].querySelectorAll("[style]").forEach(element => stripStylesFromElement(element, ["color", "background", "font", "max-width", "max-height"])); + document.getElementsByTagName("body")[0].querySelectorAll("[style]").forEach(element => stripStylesFromElement(element, ["color", "background", "font", "max-width", "max-height", "position"])); } // Convert all Feedbin proxy images to be used as src, otherwise change image locations to be absolute if not already