Options
All
  • Public
  • Public/Protected
  • All
Menu

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

Hierarchy

Index

Constructors

Methods

  • buildRules(): InputRule[]
  • Build input rules for node types present in the schema.

    Returns InputRule[]

  • #blockQuoteRule(): InputRule
  • Turn a ">" at the start of a textblock into a blockquote.

    Returns InputRule

  • #orderedListRule(): InputRule
  • Turn a number followed by a dot at the start of a textblock into an ordered list.

    Returns InputRule

  • #bulletListRule(): InputRule
  • Turn a -, +, or * at the start of a textblock into a bulleted list.

    Returns InputRule

  • #codeBlockRule(): InputRule
  • Turn three backticks at the start of a textblock into a code block.

    Returns InputRule

  • #headingRule(minLevel: number, maxLevel: number): InputRule
  • 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

  • #hrRule(): InputRule
  • Turns three hyphens at the start of a line into a horizontal rule.

    Returns InputRule

  • build(schema: Schema, [options]?: { minHeadingLevel: number }): Plugin<{}>
  • Build the plugin.

    Parameters

    • schema: Schema

      The ProseMirror schema to build the plugin against.

    • [options]: { minHeadingLevel: number } = {}

      Additional options to pass to the plugin.

      • minHeadingLevel: number

    Returns Plugin<{}>

  • #emDashRule(): InputRule
  • 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