From 4d80602fe180c574a83a38a98ccbc8b656bfc2dc Mon Sep 17 00:00:00 2001 From: Nick White Date: Tue, 13 Dec 2011 18:21:53 +0000 Subject: Only show if no leading <h1> (thanks cls) --- TODO | 6 +++--- simplyread.js | 6 ++++-- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/TODO b/TODO index c9dc9ee..40a2e1e 100644 --- a/TODO +++ b/TODO @@ -1,10 +1,10 @@ -before 0.8 - firefox xul options as on chromium - before 1.0! consider license change to isc consider renaming to PlanedText +web: + websummary should show git clone - bug + core: disable all other scripts - lots of tracking horrors around now, e.g. h-online and nytimes have things which report back every time you click the mouse. diff --git a/simplyread.js b/simplyread.js index 15baf2b..3a00527 100755 --- a/simplyread.js +++ b/simplyread.js @@ -48,6 +48,9 @@ function simplyread(nostyle, nolinks) if (biggest_num == 0) return 1; + if (biggest_tag.childNodes[1].tagName != "H1") + biggest_tag.innerHTML = "<h1>"+doc.title+"</h1>"+biggest_tag.innerHTML; + /* save and sanitise content of chosen tag */ var fresh = doc.createElement("div"); fresh.innerHTML = biggest_tag.innerHTML; @@ -74,7 +77,6 @@ function simplyread(nostyle, nolinks) doc.body.innerHTML = "<style type=\"text/css\">" + (nostyle ? "" : srstyle) + "</style>" + - "<div id=\"sr\">" + "<h1>"+doc.title+"</h1>" + fresh.innerHTML + "</div>"; - + "<div id=\"sr\">" + fresh.innerHTML + "</div>"; return 0; } -- cgit v1.2.3