A class responsible for building the input rules for the ProseMirror editor.

Hierarchy (view full)

Constructors

Methods

  • Build input rules for node types present in the schema.

    Returns InputRule[]

  • Private

    Turn a ">" at the start of a textblock into a blockquote.

    Returns InputRule

  • Private

    Turn a number followed by a dot at the start of a textblock into an ordered list.

    Returns InputRule

  • Private

    Turn a -, +, or * at the start of a textblock into a bulleted list.

    Returns InputRule

  • Private

    Turn three backticks at the start of a textblock into a code block.

    Returns InputRule

  • Private

    Turns a number of # characters followed by a space at the start of a textblock into a heading up to a maximum level.

    Parameters

    • minLevel: number

      The minimum heading level to start generating input rules for.

    • maxLevel: number

      The maximum number of heading levels.

    Returns InputRule

  • Private

    Turns three hyphens at the start of a line into a horizontal rule.

    Returns InputRule

  • Build the plugin.

    Parameters

    • schema: Schema

      The ProseMirror schema to build the plugin against.

    • Optional options: {
          minHeadingLevel: number;
      } = {}

      Additional options to pass to the plugin.

      • minHeadingLevel: number

        The minimum heading level to start from when generating heading input rules. The resulting heading level for a heading rule is equal to the number of leading hashes minus this number.

    Returns Plugin<{}>

  • Private

    Turns a double dash anywhere into an em-dash. Does not match at the start of the line to avoid conflict with the HR rule.

    Returns InputRule