@bangle.dev/text-formatting

contrib

Provides more text formatting components on top of the ones provides by @bangle.dev/core.

# peer deps
npm install @bangle.dev/core
npm install @bangle.dev/text-formatting

subscript: Component#

Allows text to marked as subscript. Note: Expects a spec named superscript to exist, you should either use it with provided superscript component or create one of yours.

spec(): MarkSpec#

plugins({ ... }): Plugins#

Named parameters:

  • keybindings: ?KeybindingsObject=defaultKeys
    For a list of allowed keys see defaultKeys below.

defaultKeys: KeybindingsObject#

  • toggleSubscript = null: toggle subscript, disabled by default.

commands: CommandObject#

  • toggleSubscript(): Command
    Toggles subscript mark.

  • queryIsSubscriptActive(): QueryCommand<boolean>
    Query if the selection is inside a subscript mark or not.

Usage

See example.

superscript: Component#

Allows text to marked as superscript. Note: Expects a spec named subscript to exist, you should either use it with provided subscript component or create one of yours.

spec(): MarkSpec#

plugins({ ... }): Plugins#

Named parameters:

  • keybindings: ?KeybindingsObject=defaultKeys
    For a list of allowed keys see defaultKeys below.

defaultKeys: KeybindingsObject#

  • toggleSuperscript = null: toggle superscript, disabled by default.

commands: CommandObject#

  • toggleSuperscript(): Command
    Toggles superscript mark.

  • queryIsSuperscriptActive(): QueryCommand<boolean>
    Query if the selection is inside a superscript mark or not.

Usage

See example.