logo

/repo|v2.5.0

Class

new ToastUIEditorViewer(options)viewer.jsline 47

Class ToastUIEditorViewer

PARAMETERS
NameTypeDescription

options

object

Option object

PROPERTIES
NameTypeDescription

el

HTMLElement

container element

initialValue

[ string ]

Editor's initial value

events

[ Object ]

Events

PROPERTIES
NameTypeDescription

load

[ function ]

It would be emitted when editor fully load

change

[ function ]

It would be emitted when content changed

stateChange

[ function ]

It would be emitted when format change by cursor position

focus

[ function ]

It would be emitted when editor get focus

blur

[ function ]

It would be emitted when editor loose focus

hooks

[ Object ]

Hooks

PROPERTIES
NameTypeDescription

previewBeforeHook

[ function ]

Submit preview to hook URL before preview be shown

plugins

[ Array ]

Array of plugins. A plugin can be either a function or an array in the form of function, options.

useDefaultHTMLSanitizer

boolean = true

use default htmlSanitizer

extendedAutolinks

[ Object ]

Using extended Autolinks specified in GFM spec

customConvertor

[ Object ]

convertor extention

linkAttribute

[ Object ]

Attributes of anchor element that should be rel, target, contenteditable, hreflang, type

customHTMLRenderer

[ Object ]

Object containing custom renderer functions correspond to markdown node

referenceDefinition

boolean = false

whether use the specification of link reference definition

customHTMLSanitizer

function = null

custom HTML sanitizer

frontMatter

boolean = false

whether use the front matter

Instance Methods

addHook(type, handler)viewer.jsline 206

Add hook to Viewer preview's event

PARAMETERS
NameTypeDescription

type

string

Event type

handler

function

Event handler

isMarkdownMode()viewer.jsline 223

Return false

RETURNS:
{

boolean

}

isViewer()viewer.jsline 215

Return true

RETURNS:
{

boolean

}

isWysiwygMode()viewer.jsline 231

Return false

RETURNS:
{

boolean

}

off(type)viewer.jsline 183

Unbind eventHandler from event type

PARAMETERS
NameTypeDescription

type

string

Event type

on(type, handler)viewer.jsline 175

Bind eventHandler to event type

PARAMETERS
NameTypeDescription

type

string

Event type

handler

function

Event handler

remove()viewer.jsline 190

Remove Viewer preview from document

setCodeBlockLanguages(languages)viewer.jsline 239

Set code block languages

PARAMETERS
NameTypeDescription

languages

Array = []

code lauguage list

setMarkdown(markdown)viewer.jsline 163

Set content for preview

PARAMETERS
NameTypeDescription

markdown

string

Markdown text

Resizable