EU Parliament Monitor - API Documentation - v0.7.0
    Preparing search index...

    Function extractArticleMeta

    • Extract title and description from a generated article HTML file. Reads the predictable template structure produced by article-template.ts. Falls back to empty strings when the file cannot be read. HTML entities from the template are decoded to produce plain text.

      NOTE: The meta description regex relies on the template's use of escapeHTML(), which converts " to ". Because descriptions are always stored with double-quote delimiters and inner quotes are HTML-encoded, the [^"]+ pattern safely captures the full value. If the template ever changes its quoting convention this regex must be updated accordingly.

      Parameters

      • filepath: string

        Path to the article HTML file

      Returns { title: string; description: string }

      Object with title (from first h1) and description (from meta description)