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​
Parameter | Type |
---|---|
| |
|
|
|
|
|
|
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​
Parameter | Type |
---|---|
| |
|
|
|
|
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​
Parameter | Type |
---|---|
| |
|
|
|
|
Returns​
boolean
linkReplace()​
function linkReplace(
editor: Editor,
index: number,
prefix: string): boolean;
Defined in: editor/modules/smartEntry.ts:100
Parameters​
Parameter | Type |
---|---|
| |
|
|
|
|
Returns​
boolean
markReplace()​
function markReplace(
editor: Editor,
index: number,
prefix: string,
wholeText: string): boolean;
Defined in: editor/modules/smartEntry.ts:119
Parameters​
Parameter | Type |
---|---|
| |
|
|
|
|
|
|
Returns​
boolean
smartEntry()​
function smartEntry(handlers: Handler[]): (editor: Editor) => object;
Defined in: editor/modules/smartEntry.ts:154
Parameters​
Parameter | Type | Default value |
---|---|---|
|
|
|
Returns​
(editor: Editor): object;
Parameters​
Parameter | Type |
---|---|
|
Returns​
object
Name | Type | Defined in |
---|---|---|
| () => | editor/modules/smartEntry.ts:173 |
textReplace()​
function textReplace(
editor: Editor,
index: number,
prefix: string): boolean;
Defined in: editor/modules/smartEntry.ts:139
Parameters​
Parameter | Type |
---|---|
| |
|
|
|
|
Returns​
boolean