Skip to content

Commit ff2380f

Browse files
committed
feat: Add byline support
1 parent b673a74 commit ff2380f

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

readability.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ import Readability from "./libs/readability.js";
22

33
const article = new Readability(document).parse();
44
const title = article.title;
5+
const byline = article.byline;
56
const content = article.content;
67

78
const titleHeader = "<title>" + title + "</title>\n";
@@ -10,4 +11,5 @@ const stylesHeader = "<style>body { font-family: 'Segoe UI'; max-width: 600px; m
1011
document.getElementsByTagName("head")[0].innerHTML = titleHeader + stylesHeader;
1112
document.body.innerHTML = null;
1213
document.body.innerHTML = "<h2>" + title + "</h2>";
14+
document.body.innerHTML += "<h3>" + byline + "</h3";
1315
document.body.innerHTML += content;

0 commit comments

Comments
 (0)