mdfetch API Documentation - v1.0.0
    Preparing search index...

    Function makeReadable

    • Extracts readable article content from HTML using Mozilla Readability.

      This function uses the Readability algorithm to extract the main article content from a web page, removing navigation, ads, and other clutter.

      Features:

      • Automatic article detection and extraction
      • Metadata extraction (title, author, published date, etc.)
      • Text direction and language detection
      • Fallback handling for malformed HTML entities

      Parameters

      • html: string

        The raw HTML content to process

      Returns Article | null

      Article object with extracted content and metadata

      When the article cannot be parsed or lacks sufficient content

      const html = await fetchHTML('https://example.com/article');
      const article = makeReadable(html);

      console.log(article.title); // Article title
      console.log(article.textContent); // Plain text content
      console.log(article.content); // HTML content
      console.log(article.byline); // Author information