EditorUtils
Represents a wrapping namespace for the utility functions, nodes, and marks objects of the Editor.
Definition
Package:@progress/kendo-vue-editor
Variables
imageResizeKey
PluginKey
The PluginKey that the image resizing plugin of the Editor uses.
imageResizeKeyCommon
marks
{ [mark: string]: MarkSpec }
Represents the marks object of the Editor.
nodes
{ [node: string]: NodeSpec }
Represents the nodes object of the Editor.
propsKey
PluginKey
The PluginKey that the Editor uses to pass its props to the tools.
editorPropsKey
Methods
Aligns the block elements in the selection.
boolean
- Returns
trueif the function aligns any of the elements.
Wraps the selection in a span element with inline styles.
boolean
- Returns
trueif the function applies a style to any of the elements.
Applies the link mark.
boolean
- Returns
trueif the function applies the link.
Checks if you can indent any of the list elements in the selection.
boolean
Checks if you can insert a node in the current selection.
The state object of the Editor.
The type of the node to insert.
Returns:boolean
Returns true if you can insert a node of this type in the current selection.
Checks if you can outdent any of the list elements in the selection.
boolean
Converts MS Word lists into HTML lists.
The input HTML.
Returns:string
The resulting HTML.
Creates an Editor document from HTML content.
The schema object of the Editor.
The HTML content.
parseOptions?ParseOptionsThe HTML parsing options. Defaults to { preserveWhitespace: 'full' }.
Node
The document object of the Editor.
Creates a table.
An object that contains the table, table_row, and table_cell node types.
The number of rows.
columnsnumberThe number of columns.
Returns:Node
The generated table.
Formats the paragraph and heading nodes in the selection.
boolean
Returns true if the function formats any element.
Returns the paragraph and heading nodes in the selection.
string[]
Gets the HTML from the EditorState object.
The state object of the Editor, or an object that contains the doc and schema of the Editor.
For example, { doc: value, schema: value.types.schema }, where value is the value prop of the Editor.
string
The HTML content.
Returns the inline styles in the selection that match the specified style.
string[]
An array of the matching styles in the selection.
Returns a mark of the specified type from the nodes in the selection.
Mark | undefined
The mark of the specified type from the nodes in the selection.
Returns the Shortcuts object that matches the settings you pass.
Use it when you change the default Editor nodes or tool settings and need to create the Shortcuts object again.
Shortcuts
An object that holds the shortcuts.
Checks if the selection contains a node that matches the specified InlineFormatOptions.
boolean
Returns true if the selection contains a node that matches the specified InlineFormatOptions.
Checks if the selection contains a specific type of node.
boolean
Returns true if the selection contains a specific type of node.
Creates a plugin that lets you resize images.
Optional. The resizing options.
Returns:Plugin
The image resizing plugin.
Indents the block elements in the selection.
boolean
Returns true if the function indents any of the elements.
Adds new lines after block elements and hard breaks.
The HTML content.
Returns:string
The indented HTML.
Inserts a node in the selection.
The view object of the Editor.
A node object of the Editor.
Optional. Sets whether the content element scrolls to the current selection.
Checks if any of the block elements in the selection is aligned.
boolean
Returns true if any of the block elements in the selection is aligned.
Checks if any of the block elements in the selection is indented.
boolean
Returns true if any of the block elements in the selection is indented.
Cleans up the pasted content (see example).
The input HTML.
settingsPasteCleanupSettingsThe settings that the function uses to clean up the content.
Returns:string
The resulting HTML.
Removes a DOM attribute from the pasted content (see example).
The DOM attribute to remove.
Removes the comments from the HTML.
The input HTML.
Returns:string
The resulting HTML.
Removes the specified tag from the HTML and keeps its child nodes.
The input HTML.
tagstringThe tag to remove. To remove more than one tag, separate them with a vertical bar.
For example, span or b|i|u|span.
string
The resulting HTML.
Replaces local image sources in the HTML with base64 sources from the RTF data.
This happens when you paste images and text from MS Word, because the src of each image points to the local file system.
The input HTML (the pasted HTML).
clipboardDataDataTransferThe clipboardData object of the paste event (event.clipboardData).
string
The HTML with the replaced image sources.
Removes the invalid HTML.
The HTML to sanitize.
Returns:string
The sanitized HTML.
Cleans up the CSS classes of content that you paste from MS Word (see example).
The function removes every class attribute whose value starts with Mso.
For example, <p class="MsoNormal">pasted from MS Word</p> becomes <p>pasted from MS Word</p>.
The DOM class attribute to clean up.
Cleans up the style attributes of content that you paste from MS Word (see example).
The function checks all styles and removes the invalid ones.
For example, <p><span style='color:#7C7C7C;mso-themecolor:accent3;mso-themeshade:191;background:silver;'>content</span></p>
becomes <p><span style="color: #7C7C7C; background: silver;">content</span></p>.
The DOM style attribute to clean up.
Sets the HTML to the EditorView.
The view object of the Editor.
The HTML content.
command?CommandOptional. The type of the command that the function sets to the setHtml metadata of the transaction.
Defaults to SetContent.
Optional. The options that the function uses to parse the HTML.
Defaults to { preserveWhitespace: 'full' }.
Creates a plugin that highlights the matches of the Find and Replace dialog.
Optional. The key of the plugin.
Returns:Plugin
The text highlight plugin.
Toggles the inline element formatting according to the InlineFormatOptions and markAttrs settings.
boolean
Toggles a list of the specified type.
boolean
Interfaces
ImageResizeOptions
ImageResizeOptions
Represents the options of the image resizing plugin.
Shortcuts
Shortcuts
Represents the Shortcuts object.