summaryrefslogtreecommitdiff
path: root/simplyread.js
diff options
context:
space:
mode:
authorNick White <git@njw.me.uk>2011-06-15 19:53:12 +0100
committerNick White <git@njw.me.uk>2011-06-15 19:53:12 +0100
commit69cc40641ee0a55acf8221741640c6c493ba8299 (patch)
treeee22773bde4a9ad263276a26a615b5abff73a5ce /simplyread.js
parent51010013037c97d9ecc18181b2a7cd2dddcdff5d (diff)
use indent rather than margin to demark paragraphs
Diffstat (limited to 'simplyread.js')
-rwxr-xr-xsimplyread.js3
1 files changed, 2 insertions, 1 deletions
diff --git a/simplyread.js b/simplyread.js
index d5a26fb..cc7afee 100755
--- a/simplyread.js
+++ b/simplyread.js
@@ -57,12 +57,13 @@ 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;
doc.body.innerHTML =
+ "<style type=\"text/css\">" +
+ " p{margin:0ex auto;} p+p{text-indent:2em;}</style>"
"<div style=\"width:38em; margin:auto; line-height: 1.4;" +
" text-align:justify; font-family:serif;" +
" text-rendering:optimizeLegibility; hyphens:auto;\">" +