HTMLReader
定义于:.build/typescript/packages/readers/src/html.ts:11
从任意HTML文档中提取重要文本。 所有头部、脚本、样式和XML标签的内容将被完全移除。 a[href]标签的URL将被提取,同时保留标签内的文本内容。 所有其他标签将被移除,但保留其内部文本不变。 HTML实体(例如&)不会被解码。
FileReader<Document>
new HTMLReader():
HTMLReader
HTMLReader
FileReader<Document>.constructor
loadDataAsContent()
Section titled “loadDataAsContent()”loadDataAsContent(
fileContent):Promise<Document<Metadata>[]>
定义于:.build/typescript/packages/readers/src/html.ts:18
该读取器的公共方法。 BaseReader接口所要求的。
fileContent
Section titled “fileContent”Uint8Array
文件的内容。
Promise<Document<Metadata>[]>
Promise<Document[]> 一个 Promise 对象,最终会从指定文件的 HTML 内容中解析出零个或一个 Document。
FileReader.loadDataAsContent
parseContent()
Section titled “parseContent()”parseContent(
html,options):Promise<string>
定义于:.build/typescript/packages/readers/src/html.ts:33
用于 string-strip-html 的包装器。
string
待解析的原始HTML内容。
Partial<Opts> = {}
底层库的选项对象
Promise<string>
HTML内容,已去除不需要的标签和属性
getOptions
getOptions()
Section titled “getOptions()”getOptions():
Partial<Opts>
定义于:.build/typescript/packages/readers/src/html.ts:46
传递给 string-strip-html 库的配置选项包装器
Partial<Opts>
底层库的选项对象