MCPcopy Create free account
hub / github.com/Y80/bmm / parseWithReadability

Function parseWithReadability

src/utils/extract-article.ts:54–57  ·  view source on GitHub ↗

用 Readability 解析 HTML,返回文章对象或 null

(html: string, url: string)

Source from the content-addressed store, hash-verified

52
53/** 用 Readability 解析 HTML,返回文章对象或 null */
54function parseWithReadability(html: string, url: string) {
55 const { document } = parseHTML(absolutifyUrls(html, url))
56 return new Readability(document).parse()
57}
58
59/** 从 __NEXT_DATA__ JSON 中递归寻找最长的文章 HTML 字符串和标题
60 *

Callers 1

extractArticleFromHtmlFunction · 0.85

Calls 1

absolutifyUrlsFunction · 0.85

Tested by

no test coverage detected