@grafctory/core - v0.15.0
    Preparing search index...

    Function summary

    • Extracts the summary of markdown content.

      Returns the leading paragraph as the gist of the content, for a listing, a tooltip or a card to show at a glance. The paragraphs following it are left to details, for readers asking for more. Content is read as follows:

      • Line terminators (\r\n, \r, \n) are normalised to \n
      • A front matter block between --- fences at the start of the content is skipped; an unclosed fence is content
      • A line holding only whitespace is blank, and the first blank line closes the leading paragraph
      • A leading paragraph that doesn't open with a letter, such as a heading, a list item or a thematic break, isn't prose: no summary is returned, and the paragraphs following it are never used in its place
      • A paragraph wrapped across several lines is folded to a single line as tidy does, then clipped to 80 code points as clip does; a single-line paragraph is returned whole, since its length is the author's choice

      Parameters

      • markdown: string

        The markdown content to summarise

      Returns Optional<string>

      The trimmed leading paragraph of markdown, folded and clipped if wrapped across several lines; undefined if markdown is blank or its leading paragraph doesn't open with a letter

      details for the companion extraction, returning the content kept for readers asking for more