@akira108sys/html-rewriter-readability
Version:
A library to extract readable content with Mozilla/Readability algorithm using Cloudflare HTMLRewriter.
20 lines (19 loc) • 585 B
TypeScript
import type { Metadata, ReadabilityOptions } from './types';
export declare class HtmlRewriterReadability {
private elementStore;
private metadataStore;
private elementCounter;
private elementsToKeepIdsSet;
private options;
private baseURI;
constructor(baseURI: string | URL, options?: ReadabilityOptions);
private resetState;
private runPhase1;
private runPhase2;
private convertToMarkdown;
process(response: Response): Promise<{
markdown: string;
metadata: Metadata;
} | null>;
private static defaultOptions;
}