Options
All
  • Public
  • Public/Protected
  • All
Menu

Module "lib/Markdown"

Index

Functions

codeProcessor

  • codeProcessor(text: string): string
  • Transform everything but the interior of inline code segments, i.e., `code`, but still be able to process elements that wrap around inlide code formatting.

    Parameters

    • text: string

      input string

    Returns string

    transformed string with unchanged inline code segments

codeTag

  • codeTag(i: number): string
  • Provide a unique identifier for later replacement.

    Parameters

    • i: number

    Returns string

convertFormat

  • convertFormat(text: string): string
  • Replace Markdown bold, italic, and unordered lists with their Slack markup equivalent.

    Parameters

    • text: string

      string with Markdown

    Returns string

    string with Slack markup

convertImageLinks

  • convertImageLinks(text: string): string
  • Replace Markdown image links with just the image URL.

    Parameters

    • text: string

      string with Markdown

    Returns string

    string with image URLs

convertInlineImages

  • convertInlineImages(text: string): string
  • Replace tags with just the image URL.

    Parameters

    • text: string

      string which may have img tags

    Returns string

    string with img tags replaced

convertLinks

  • convertLinks(text: string): string
  • Replace Markdown links with Slack markup links.

    Parameters

    • text: string

      string with Markdown

    Returns string

    string with Slack markup

convertMarkdown

  • convertMarkdown(text: string): string
  • Convert sections of text from GitHub-flavored Markdown to Slack message markup. This function should not be passed inline code or code blocks. The ordering of the functions called is significant.

    Parameters

    • text: string

      string containing Markdown

    Returns string

    string converted to Slack markup

convertNamedLinks

  • convertNamedLinks(text: string): string
  • Replace named Markdown links with parenthesized links.

    Parameters

    • text: string

      string which may have named Markdown links

    Returns string

    string with explicit links

githubToSlack

  • githubToSlack(text: string): string
  • Convert GitHub-flavored Markdown to Slack message markup. This is not a complete implementation of a Markdown parser, but it does its level best.

    Parameters

    • text: string

      string containing markdown

    Returns string

    string with Slack markup

trailingSpace

  • trailingSpace(match: string, url: string, space: string, offset: number, full: string): string
  • Try to handle adjacent HTML and Markdown elements that cannot be adjacent in Slack markup. Used as the function argument of replace.

    Parameters

    • match: string

      the full match

    • url: string

      the URL

    • space: string

      trailing space, if it exists

    • offset: number
    • full: string

    Returns string

    properly padded replacement string

Generated using TypeDoc