EditorUtils
Represents a wrapping namespace for the utility functions, nodes, and marks objects of the Editor.
Definition
Package:@progress/kendo-react-editor
Variables
imageResizeKey
PluginKey
The PluginKey used in the Editor by the image resizing plugin.
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 used in the Editor to pass editor props to the tools.
editorPropsKey
Methods
Aligns the block elements in the selection.
boolean
—If alignment is applied to any of the elements, returns true.
Wraps the selection in a span element with inline styles.
boolean
—If a style is applied to any of the elements, returns true.
Applies the link mark.
boolean
—If the link is applied, returns true.
Checks if any of the list elements in the selection can be indented.
boolean
Checks if a node can be inserted in the current selection.
boolean
—The node of this type can be inserted in the current selection.
Checks if any of the list elements in the selection can be outdented.
boolean
Converts the MS Word lists into HTML lists.
string
—The result HTML.
Creates an Editor document from HTML content.
Node
—The document object of the Editor.
Creates a table.
Node
—The generated table.
Formats the paragraph and heading nodes in the selection.
boolean
—If an element is formatted, returns true.
Returns the paragraph and heading nodes in the selection.
string[]
Gets the HTML from the EditorState object.
string
—The HTML content.
string[]
—An array of matched styles that are found in the selection.
Returns a mark of the specified type from the nodes in selection.
Mark | undefined
A function which returns the mapped Shortcuts object based on the passed settings.
Useful when the default Editor nodes or tool settings are changed and the Shortcuts object has to be regenerated.
@params—An object which holds specific types of nodes and tool settings that are used by the default Shortcuts handlers.
@returns—An object which holds the shortcuts.
Shortcuts
Checks if according to the specified InlineFormatOptions a node in the selection is present.
boolean
Checks if the selection contains a specific type of node.
boolean
Creates a plugin which adds image resizing functionality.
Plugin
—The image resizing plugin.
Indents the block elements in the selection.
boolean
—If indentation is applied to any of the elements, returns true.
Adds new lines after block elements and hard breaks.
string
—The indented HTML.
Inserts a node in the selection.
Checks if any of the block elements in the selection is aligned.
boolean
Checks if any of the block elements in the selection is indented.
boolean
A function for sanitizing the content on paste (see example).
A function that will remove a DOM attribute from the pasted content (see example).
Removes the comments from the HTML.
string
—The result HTML.
Removes the specified tag from the HTML and keeps its child nodes.
string
—The resulting HTML.
If the input html contains images with 'src' pointing to local file system (it happens when pasting images and text from MS Word),
the function will extract the images sources from the RTF in base64 format and replace them in the input html.
string
Removes the invalid HTML.
string
—The sanitized HTML.
A function for sanitizing the CSS classes of the pasted from MS Word content (see example).
The function will remove any class attribute which value starts with Mso.
For example <p class="MsoNormal">pasted from MS Word</p> will result in <p>pasted from MS Word</p>.
A function for sanitizing the style attributes of the pasted from MS Word content (see example).
The function will loop through all styles and will remove those that are invalid.
For example <p><span style='color:#7C7C7C;mso-themecolor:accent3;mso-themeshade:191;background:silver;'>content</span></p>,
will result in <p><span style="color: #7C7C7C; background: silver;">content</span></p>.
Sets the HTML to the EditorView.
Returns a collection of plugins that adds table resizing functionality.
Plugin[]
—The table resizing plugins.
Creates a plugin which highlights the matches of Find and Replace dialog.
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
The image resizing plugin options.
Shortcuts
Shortcuts
Represents the Shortcuts object.