Bug 784683 - Don't create temporary H1 element for title (r=mfinkle)
authorLucas Rocha <lucasr@mozilla.com>
Wed, 22 Aug 2012 18:17:45 +0100
changeset 105076 e97800e74b636eb088edd68ee219a8a30c7dc9b3
parent 105075 fcb1cb11935f91aa0778837f98235123e5422ca0
child 105077 b87b0846c9137de02fdf9a0e8e1db19231cf3098
push id55
push usershu@rfrn.org
push dateThu, 30 Aug 2012 01:33:09 +0000
reviewersmfinkle
bugs784683
milestone17.0a1
Bug 784683 - Don't create temporary H1 element for title (r=mfinkle)
mobile/android/chrome/content/Readability.js
--- a/mobile/android/chrome/content/Readability.js
+++ b/mobile/android/chrome/content/Readability.js
@@ -174,20 +174,17 @@ Readability.prototype = {
         curTitle = this._getInnerText(hOnes[0]);
     }
 
     curTitle = curTitle.replace(this.REGEXPS.trim, "");
 
     if (curTitle.split(' ').length <= 4)
       curTitle = origTitle;
 
-    let articleTitle = doc.createElement("H1");
-    articleTitle.innerHTML = curTitle;
-
-    return articleTitle;
+    return curTitle;
   },
 
   /**
    * Prepare the HTML document for readability to scrape it.
    * This includes things like stripping javascript, CSS, and handling terrible markup.
    *
    * @return void
    **/
@@ -1350,13 +1347,13 @@ Readability.prototype = {
     // if (nextPageLink) {
     //   // Append any additional pages after a small timeout so that people
     //   // can start reading without having to wait for this to finish processing.
     //   setTimeout((function() {
     //     this._appendNextPage(nextPageLink);
     //   }).bind(this), 500);
     // }
 
-    return { title: this._getInnerText(articleTitle),
+    return { title: articleTitle,
              byline: this._articleByline,
              content: articleContent.innerHTML };
   }
 };