At any given Location or Span in the editor provided by at (default is the current selection), the method returns a Generator of NodeEntry objects that represent the nodes that include at. At the top of the hierarchy is the Editor object itself.
offset: Moves to the next offset Point. It will include the Point at the end of a Text object and then move onto the first Point (at the 0th offset) of the next Text object. This may be counter-intuitive because the end of a Text and the beginning of the next Text might be thought of as the same position.
character: Moves to the next character but is not always the next index in the string. This is because Unicode encodings may require multiple bytes to create one character. Unlike offset, character will not count the end of a Text and the beginning of the next Text as separate positions to return. Warning: The character offsets for Unicode characters does not appear to be reliable in some cases like a Smiley Emoji will be identified as 2 characters.
word: Moves to the position immediately after the next word. In reverse mode, moves to the position immediately before the previous word.
line | block: Starts at the beginning position and then the position at the end of the block. Then starts at the beginning of the next block and then the end of the next block.
reverse?: boolean = false: When true returns the positions in reverse order. In the case of the unit being word, the actual returned positions are different (i.e. we will get the start of a word in reverse instead of the end).
voids?: boolean = false: When true include void Nodes.
Call a function, deferring normalization until after it completes.
Schema-specific instance methods to override
Replace these methods to modify the original behavior of the editor when building Plugins. When modifying behavior, call the original method when appropriate. For example, a plugin that marks image nodes as "void":
Add a custom property to the leaf text nodes in the current selection. If the selection is currently collapsed, the marks will be added to the editor.marks property instead, and applied when text is inserted next.
removeMark(key: string) => void
Remove a custom property from the leaf text nodes in the current selection.
getFragment() => Descendant
Returns the fragment at the current selection. Used when cutting or copying, as an example, to get the fragment at the current selection.
When a user presses backspace or delete, it invokes the method based on the selection. For example, if the selection is expanded over some text and the user presses the backspace key, deleteFragment will be called but if the selecttion is collapsed, deleteBackward will be called.