Class: MDEditorBase

MDEditorBase

Markdown editor


new MDEditorBase(options)

Parameters:
Name Type Description
options Object

a list of options

Properties
Name Type Argument Default Description
input Element

the textarea to use as input

output Element <optional>

element to use as output

data Element <optional>

a list of key value to replace in the markdown %key%

minibar boolean <optional>
true
scrolling boolean <optional>
false
Source:
md/MDEditorBase.js
Fires:
  • event:change

Extends

  • ol_Object

Methods


_onchange()

Something has change > save for undo

Source:
md/MDEditorBase.js

addSeparatorTool()

Add a new tool to the toolbar

Source:
md/MDEditorBase.js

addTool()

Add a new tool to the toolbar

Source:
md/MDEditorBase.js

charAt(n)

Get char at

Parameters:
Name Type Description
n number

index

Source:
md/MDEditorBase.js

clearUndo()

Clear undo/redo

Source:
md/MDEditorBase.js

edit(options)

Markdown editor

Parameters:
Name Type Description
options *
Properties
Name Type Description
type line | insert | selection | fn | dialog

operation type

val

value to insert

wrap Array.<string>

wrap word with

fn function

a function to use when type = 'fn' or 'dialog'

Source:
md/MDEditorBase.js

getValue()

Get the current value

Source:
md/MDEditorBase.js
Returns:

md

Type
string

mdFullDialog()

Display a fulldialog

Source:
md/MDEditorBase.js

refresh()

Refresh output (with delay)

Source:
md/MDEditorBase.js

setDialogClassName(className)

Set dialog class name

Parameters:
Name Type Description
className string
Source:
md/MDEditorBase.js

setTools(minibar)

Add a new tool to the toolbar

Parameters:
Name Type Description
minibar boolean
Source:
md/MDEditorBase.js

setValue(md)

Set the current value

Parameters:
Name Type Description
md string
Source:
md/MDEditorBase.js

wrap(st, e)

Wrap char

Parameters:
Name Type Description
st string

a 2 char length string

e Event
Source:
md/MDEditorBase.js