Skip to content

Commit be6b1e7

Browse files
authored
Fix "<ol> tag is dropped from an ordered list" #913 (#914)
* Add test case * Fix
1 parent 6243980 commit be6b1e7

File tree

4 files changed

+24
-1
lines changed

4 files changed

+24
-1
lines changed

Readability.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -196,7 +196,7 @@ Readability.prototype = {
196196
"UL",
197197
]),
198198

199-
ALTER_TO_DIV_EXCEPTIONS: ["DIV", "ARTICLE", "SECTION", "P"],
199+
ALTER_TO_DIV_EXCEPTIONS: ["DIV", "ARTICLE", "SECTION", "P", "OL", "UL"],
200200

201201
PRESENTATIONAL_ATTRIBUTES: [
202202
"align",
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
{
2+
"title": "",
3+
"byline": null,
4+
"dir": null,
5+
"excerpt": "AI hasn’t meaningfully changed anything in cybersecurity so far. Deep fake phishing is still rare, L",
6+
"siteName": null,
7+
"publishedTime": null,
8+
"readerable": false
9+
}

test/test-pages/ol/expected.html

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
<div id="readability-page-1" class="page">
2+
<ol>
3+
<li>
4+
<p>AI hasn’t meaningfully changed anything in cybersecurity so far. Deep fake phishing is still rare, L</p>
5+
</li>
6+
</ol>
7+
</div>

test/test-pages/ol/source.html

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
<html>
2+
<body>
3+
<ol>
4+
<li><p>AI hasn’t meaningfully changed anything in cybersecurity so far. Deep fake phishing is still rare, L</p></li>
5+
</ol>
6+
</body>
7+
</html>

0 commit comments

Comments
 (0)