ToastUIEditorViewer(options)

Class ToastUIEditorViewer

new ToastUIEditorViewer(options)

Viewer

Parameters:
Name Type Description
options object

Option object

Properties
Name Type Description
initialValue string

Editor's initial value

events object

eventlist Event list

Properties
Name Type Description
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

Hook list

Properties
Name Type Description
previewBeforeHook function

Submit preview to hook URL before preview be shown

Members

static codeBlockManager :CodeBlockManager

CodeBlockManager instance

static domUtils :DomUtil

domUtil instance

static isViewer :boolean

check whther is viewer

static markdownitHighlight :MarkdownIt

MarkdownIt hightlight instance

Methods

static defineExtension(name, ext)

Define extension

Parameters:
Name Type Description
name string

Extension name

ext ExtManager~extension

extension

addHook(type, handler)

Add hook to Viewer preview's event

Parameters:
Name Type Description
type string

Event type

handler function

Event handler

isMarkdownMode() → {boolean}

Return false

Returns:
boolean

isViewer() → {boolean}

Return true

Returns:
boolean

isWysiwygMode() → {boolean}

Return false

Returns:
boolean

off(type)

Unbind eventHandler from event type

Parameters:
Name Type Description
type string

Event type

on(type, handler)

Bind eventHandler to event type

Parameters:
Name Type Description
type string

Event type

handler function

Event handler

remove()

Remove Viewer preview from document

setMarkdown(markdown)

Set content for preview

Parameters:
Name Type Description
markdown string

Markdown text

setValue(markdown)

Set content for preview

Parameters:
Name Type Description
markdown string

Markdown text

Deprecated:
  • Yes