Options
All
  • Public
  • Public/Protected
  • All
Menu

Interface AutoformatTextOptions

Hierarchy

Index

Properties

format

format: string | string[] | ((editor: TEditor<AnyObject>, options: GetMatchPointsReturnType) => void)

string: the matched text is replaced by that string. string[]: the matched texts are replaced by these strings. function: called when there is a match.

Optional insertTrigger

insertTrigger: boolean

If true, insert the triggering character after autoformatting.

default:

false

match

match: string | string[]

The rule applies when the trigger and the text just before the cursor matches. For mode: 'block': lookup for the end match(es) before the cursor. For mode: 'text': lookup for the end match(es) before the cursor. If format is an array, also lookup for the start match(es). For mode: 'mark': lookup for the start and end matches. Note: '_*', ['_*'] and { start: '_*', end: '*_' } are equivalent.

mode

mode: "text"

Optional query

query: (editor: TEditor<AnyObject>, options: AutoformatQueryOptions) => boolean

Query to allow autoformat.

Type declaration

text

text: string

Optional trigger

trigger: string | string[]

Triggering character to autoformat.

default

the last character of match or match.end

Generated using TypeDoc