Class Renderer

A class that stores materialized options for rendering NPF to HTML.

Callers may extend this class and override any of its render*() methods to change the way particular NPF components are rendered.

Constructors

Properties

askingAvatar: VisualMedia[]

Options.askingAvatar

prefix: string

Options.prefix

Methods

  • Escapes all characters in text that aren't safe to use literally in HTML text or attributes.

    Parameters

    • text: string

    Returns string

  • HTML-escapes text and formats it according to formatting.

    Parameters

    Returns string

  • Wraps html as an ask.

    Parameters

    Returns string

  • Converts attribution to HTML.

    Parameters

    Returns string

  • Converts media to HTML.

    Parameters

    • media: VisualMedia[]
    • Optionaloptions: {
          alt?: string;
      }
      • Optionalalt?: string

        The alt text for the media.

    Returns string

  • Applies the formatting specified by format to html, which may already include nested formatting.

    The html has already been trimmed to only the section to which format applies.

    Parameters

    Returns string

  • Wraps html as single row.

    Parameters

    Returns string

  • Converts blocksAndNested to HTML.

    The first element of blocksAndNested determines the subtype of the entire thing; any other blocks are guaranteed to have the same subtype. The string elements of blocksAndNested ar TextBlockIndented objects which are more deeply nested and have already been converted to HTML.

    Parameters

    Returns string

  • Renders html as a "below the fold" read more.

    Parameters

    • html: string

    Returns string