Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions Readability.js
Original file line number Diff line number Diff line change
Expand Up @@ -223,6 +223,7 @@ Readability.prototype = {
"ABBR",
"AUDIO",
"B",
"BDI",
"BDO",
"BR",
"BUTTON",
Expand All @@ -247,6 +248,7 @@ Readability.prototype = {
"PROGRESS",
"Q",
"RUBY",
"S",
"SAMP",
"SCRIPT",
"SELECT",
Expand Down
13 changes: 13 additions & 0 deletions test/test-readability.js
Original file line number Diff line number Diff line change
Expand Up @@ -340,6 +340,19 @@ describe("Readability API", function () {
expect(content).eql(expected_xhtml);
});

it("should keep S and BDI inline within paragraphs", function () {
var dom = new JSDOM(
"<div>Lorem ipsum dolor sit amet, consectetur adipiscing elit. " +
"Nunc mollis leo lacus, <s>vitae</s> semper <bdi>nisl</bdi> " +
"ullamcorper ut praesent in lectus eu nibh dapibus tincidunt.</div>"
);
var content = new Readability(dom.window.document, {
charThreshold: 20,
}).parse().content;
expect(content).not.to.contain("</p><s>");
expect(content).not.to.contain("</p><bdi>");
});

it("should use custom video regex sent as option", function () {
var dom = new JSDOM(
"<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nunc mollis leo lacus, vitae semper nisl ullamcorper ut.</p>" +
Expand Down