Method List
In addition to the methods provided in the Umo Editor Method List, Umo Editor Next provides the following methods:
Method Description
Usage is the same as Umo Editor Method List.
getThumbnail
Description: Get the thumbnail of the document.
Parameters:
scale, Number, thumbnail scale ratio, default value is0.5.
Return: Thumbnail of the document in Blob format or directly throws an error.
insertMarkdown
Description: Insert Markdown formatted text.
Parameters:
markdown: String, Markdown text.options: MarkdownIt configuration options, see: https://markdown-it.github.io/markdown-it/#MarkdownIt.new
Return: None
getJSONByMarkdown
Description: Convert Markdown text to JSON format data that Umo Editor can recognize.
Parameters:
markdown: String, Markdown text.exRules: Object, Markdown extension rules.
Return: JSON format data that Umo Editor can recognize or null.
startTypewriter
Description: Insert content with typewriter effect.
Parameters:
content: JSON format data that Umo Editor can recognize.options:speed:Number, interval time for typewriter text input.step:Number, typewriter step length, the number of characters displayed each time. To ensure the effect, it is recommended not to be too long.onComplete:function, callback function after typewriter completion.
Return: None.
stopTypewriter
Description: Stop the typewriter content insertion effect.
Parameters: None.
Return: None.
getTypewriterState
Description: Get the running state of the typewriter.
Parameters: None.
Return:
isRunning:BooleanCurrent running state of the typewriter,trueindicates it is running,falseindicates the typewriter has stopped.currentParagraph:NumberThe current paragraph position where the typewriter is running.currentTextNode:NumberThe current text node position under the paragraph where the typewriter is running.currentChar:NumberThe current character position under the paragraph where the typewriter is running.