MdListManager

MdListManager

Constructor

new MdListManager(mde)

Parameters:
Name Type Description
mde MarkdownEditor

MarkdownEditor instance

Members

static this.name :string

Name property

Methods

appendBlankLineIfNeed(cm, index, endLineNumber, startLineNumber)

Append blank line at list top or bottom if needed

Parameters:
Name Type Description
cm CodeMirror

CodeMirror instance

index number

index number

endLineNumber number

end line index number

startLineNumber number

start line index number

createSortedLineRange(range) → {Object}

Sort line number of selection descending

Parameters:
Name Type Description
range Object

start, end CodeMirror range information

Returns:
Object

expandLineRangeIfNeed(doc, range, comparator) → {Object}

Expand line range if need

Parameters:
Name Type Description
doc object

doc instance

range Object

CodeMirror range information

comparator function

comparator function

Returns:
Object

isListOrParagraph(line) → {boolean}

Return whether passed line is list or paragraph or not

Parameters:
Name Type Description
line string

line text

Returns:
boolean

replaceLineText(doc, lineNumber, regexp, replacePattern)

Replace list syntax

Parameters:
Name Type Description
doc object

CodeMirror doc instance

lineNumber number

Line number

regexp RegExp

Regexp for find list syntax

replacePattern string

Replacement string