MCPcopy Index your code
hub / github.com/tinymce/tinymce / isAtEdgeOfBlock

Function isAtEdgeOfBlock

modules/tinymce/src/core/main/ts/api/html/DomParser.ts:213–222  ·  view source on GitHub ↗
(node: AstNode, start: boolean)

Source from the content-addressed store, hash-verified

211 node.name in blockElements || TransparentElements.isTransparentAstBlock(schema, node) || (Namespace.isNonHtmlElementRootName(node.name) && node.parent === root);
212
213 const isAtEdgeOfBlock = (node: AstNode, start: boolean): boolean => {
214 const neighbour = start ? node.prev : node.next;
215 if (Type.isNonNullable(neighbour) || Type.isNullable(node.parent)) {
216 return false;
217 }
218
219 // Make sure our parent is actually a block, and also make sure it isn't a temporary "context" element
220 // that we're probably going to unwrap as soon as we insert this content into the editor
221 return isBlock(node.parent) && (node.parent !== root || args.isRootContent === true);
222 };
223
224 const preprocess = (node: AstNode) => {
225 if (node.type === 3) {

Callers 2

preprocessFunction · 0.85
postprocessFunction · 0.85

Calls 1

isBlockFunction · 0.70

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…