Skip to main content

smartEntry

Documentation / editor/modules/smartEntry

Handler()​

type Handler = (editor?: Editor, index?: number, prefix?: string, wholeText?: string) => void;

Defined in: editor/modules/smartEntry.ts:10

Parameters​

ParameterType

editor?

Editor

index?

number

prefix?

string

wholeText?

string

Returns​

void


Replacement​

type Replacement = [RegExp, (captured: string, attr: AttributeMap) => AttributeMap];

Defined in: editor/modules/smartEntry.ts:4


TextReplacement​

type TextReplacement = [RegExp, (captured: string) => string];

Defined in: editor/modules/smartEntry.ts:5


defaultHandlers​

const defaultHandlers: (editor: Editor, index: number, prefix: string) => boolean[];

Defined in: editor/modules/smartEntry.ts:151

Allow text representations to format a line

Parameters​

ParameterType

editor

Editor

index

number

prefix

string

Returns​

boolean


lineReplacements​

const lineReplacements: Replacement[];

Defined in: editor/modules/smartEntry.ts:16

A list of [ RegExp, Function ] tuples to convert text into a formatted line with the attributes returned by the function. The function's argument will be the captured text from the regular expression.


linkReplacements​

const linkReplacements: Replacement[];

Defined in: editor/modules/smartEntry.ts:63


markReplacements​

const markReplacements: Replacement[];

Defined in: editor/modules/smartEntry.ts:57

A list of [ RegExp, Function ] tuples to convert text into formatted text with the attributes returned by the function. The function's argument will be the captured text from the regular expression.


textReplacements​

const textReplacements: TextReplacement[];

Defined in: editor/modules/smartEntry.ts:73

A list of [ RegExp, Function ] tuples to convert text into another string of text which is returned by the function. The function's argument will be the captured text from the regular expression.


lineReplace()​

function lineReplace(
editor: Editor,
index: number,
prefix: string): boolean;

Defined in: editor/modules/smartEntry.ts:82

Allow text representations to format a line

Parameters​

ParameterType

editor

Editor

index

number

prefix

string

Returns​

boolean


linkReplace()​

function linkReplace(
editor: Editor,
index: number,
prefix: string): boolean;

Defined in: editor/modules/smartEntry.ts:100

Parameters​

ParameterType

editor

Editor

index

number

prefix

string

Returns​

boolean


markReplace()​

function markReplace(
editor: Editor,
index: number,
prefix: string,
wholeText: string): boolean;

Defined in: editor/modules/smartEntry.ts:119

Parameters​

ParameterType

editor

Editor

index

number

prefix

string

wholeText

string

Returns​

boolean


smartEntry()​

function smartEntry(handlers: Handler[]): (editor: Editor) => object;

Defined in: editor/modules/smartEntry.ts:154

Parameters​

ParameterTypeDefault value

handlers

Handler[]

defaultHandlers

Returns​

(editor: Editor): object;

Parameters​

ParameterType

editor

Editor

Returns​

object

NameTypeDefined in

destroy()

() =>

editor/modules/smartEntry.ts:173


textReplace()​

function textReplace(
editor: Editor,
index: number,
prefix: string): boolean;

Defined in: editor/modules/smartEntry.ts:139

Parameters​

ParameterType

editor

Editor

index

number

prefix

string

Returns​

boolean