summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNick White <git@njw.me.uk>2010-11-16 19:20:26 +0000
committerNick White <git@njw.me.uk>2010-11-16 19:20:26 +0000
commit05db972ef74e6ad632edb68ab19ab217f084149f (patch)
treeca255244a2d09b412cb0741388fb683a888002e3
parenta32442c4cc529707dc13dbe1842d505b47308665 (diff)
Work around paragraph margin problems
-rw-r--r--BUGS7
-rwxr-xr-xsimplyread.js1
2 files changed, 1 insertions, 7 deletions
diff --git a/BUGS b/BUGS
index 5d39c68..e69de29 100644
--- a/BUGS
+++ b/BUGS
@@ -1,7 +0,0 @@
-With Gecko styles aren't reliably cleared. Example
-http://www.guardian.co.uk/commentisfree/2010/oct/30/google-polluting-internet
-screws up paragraph spacing (too close together).
-Seems to be fine with webkit.
-The issue is that for some reason on first run not all stylesheets
-are disabled in firefox. Subsequent runs are fine. Presumably it's a
-bug in firefox; should report it to them.
diff --git a/simplyread.js b/simplyread.js
index ff2675e..45c9570 100755
--- a/simplyread.js
+++ b/simplyread.js
@@ -62,6 +62,7 @@ function simplyread()
fresh.innerHTML = fresh.innerHTML.replace(/<\/?font[^>]*>/g, "");
fresh.innerHTML = fresh.innerHTML.replace(/style="[^"]*"/g, "");
fresh.innerHTML = fresh.innerHTML.replace(/<\/?a[^>]*>/g, "");
+ fresh.innerHTML = fresh.innerHTML.replace(/<p/g, "<p style=\"margin: 1em 0em;\"");
for (var i = 0; i < doc.styleSheets.length; i++)
doc.styleSheets[i].disabled = true;