Skip to content

Commit

Permalink
Fix "<ol> tag is dropped from an ordered list" #913 (#914)
Browse files Browse the repository at this point in the history
* Add test case

* Fix
  • Loading branch information
beala authored Oct 17, 2024
1 parent 6243980 commit be6b1e7
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 1 deletion.
2 changes: 1 addition & 1 deletion Readability.js
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,7 @@ Readability.prototype = {
"UL",
]),

ALTER_TO_DIV_EXCEPTIONS: ["DIV", "ARTICLE", "SECTION", "P"],
ALTER_TO_DIV_EXCEPTIONS: ["DIV", "ARTICLE", "SECTION", "P", "OL", "UL"],

PRESENTATIONAL_ATTRIBUTES: [
"align",
Expand Down
9 changes: 9 additions & 0 deletions test/test-pages/ol/expected-metadata.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"title": "",
"byline": null,
"dir": null,
"excerpt": "AI hasn’t meaningfully changed anything in cybersecurity so far. Deep fake phishing is still rare, L",
"siteName": null,
"publishedTime": null,
"readerable": false
}
7 changes: 7 additions & 0 deletions test/test-pages/ol/expected.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<div id="readability-page-1" class="page">
<ol>
<li>
<p>AI hasn’t meaningfully changed anything in cybersecurity so far. Deep fake phishing is still rare, L</p>
</li>
</ol>
</div>
7 changes: 7 additions & 0 deletions test/test-pages/ol/source.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<html>
<body>
<ol>
<li><p>AI hasn’t meaningfully changed anything in cybersecurity so far. Deep fake phishing is still rare, L</p></li>
</ol>
</body>
</html>

0 comments on commit be6b1e7

Please sign in to comment.