Fixes #163 - Avoid including footer tag contents.

pull/169/head
Nicolas Perriault 9 years ago
parent eb7ec7231e
commit 12c6a11f67

@ -389,6 +389,7 @@ Readability.prototype = {
this._clean(articleContent, "object");
this._clean(articleContent, "embed");
this._clean(articleContent, "h1");
this._clean(articleContent, "footer");
// If there is only one h2, they are probably using it as a header
// and not a subheader, so remove it since we already have a header.

@ -565,14 +565,5 @@ res.<span>text</span><span>(</span><span>)</span>.<span>catch</span><span>(</spa
Kelly for helping with the specification and implementation.</em>
</p>
<footer class="entry-meta">
<p>Posted by <a href="https://hacks.mozilla.org/author/nmarathemozilla-com/"
title="Posts by Nikhil Marathe" class="url fn" rel="author">Nikhil Marathe</a>
on
<time
datetime="2015-03-10T08:05:41-07:00">March 10, 2015</time>at
<time datetime="PDT08:05:41-07:00">08:05</time>
</p>
</footer>
</article>
</div>
</div>

@ -22,7 +22,7 @@ function runTestsWithItems(label, beforeFn, expectedContent, expectedMetadata) {
});
it("should extract expected content", function() {
expect(expectedContent).eql(prettyPrint(result.content));
expect(expectedContent.split("\n")).eql(prettyPrint(result.content).split("\n"));
});
it("should extract expected title", function() {

Loading…
Cancel
Save