How to use the @remirror/core.isElementDOMNode function in @remirror/core

To help you get started, we’ve selected a few @remirror/core examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github ifiokjr / remirror / @remirror / extension-code-block / src / code-block-extension.ts View on Github external
getAttrs: node => {
            if (!isElementDOMNode(node)) {
              return false;
            }

            const codeElement = node.querySelector('code');

            if (!isElementDOMNode(codeElement)) {
              return false;
            }

            const language = codeElement.getAttribute(dataAttribute);
            return { language };
          },
        },
github ifiokjr / remirror / @remirror / extension-code-block / src / code-block-extension.ts View on Github external
getAttrs: node => {
            if (!isElementDOMNode(node)) {
              return false;
            }

            const codeElement = node.querySelector('code');

            if (!isElementDOMNode(codeElement)) {
              return false;
            }

            const language = codeElement.getAttribute(dataAttribute);
            return { language };
          },
        },
github ifiokjr / remirror / @remirror / extension-mention / src / mention-extension.ts View on Github external
getAttrs: node => {
            if (!isElementDOMNode(node)) {
              return false;
            }

            const id = node.getAttribute(dataAttributeId);
            const name = node.getAttribute(dataAttributeName);
            const label = node.innerText;
            return { id, label, name };
          },
        },
github ifiokjr / remirror / @remirror / core-extensions / src / marks / bold-extension.ts View on Github external
          getAttrs: node => (isElementDOMNode(node) && node.style.fontWeight !== 'normal' ? null : false),
        },
github ifiokjr / remirror / @remirror / extension-image / src / image-extension.ts View on Github external
          getAttrs: domNode => (isElementDOMNode(domNode) ? getAttrs(this.getExtraAttrs(domNode)) : {}),
        },
github ifiokjr / remirror / packages / jest-prosemirror / src / utils.ts View on Github external
export const findTextNode = (node: Node, text: string): Node | undefined => {
  if (isTextDOMNode(node)) {
    return node;
  } else if (isElementDOMNode(node)) {
    for (let ch = node.firstChild; ch; ch = ch.nextSibling) {
      const found = findTextNode(ch, text);
      if (found) {
        return found;
      }
    }
  }
  return undefined;
};
github ifiokjr / remirror / @remirror / core-extensions / src / marks / bold.ts View on Github external
          getAttrs: node => (isElementDOMNode(node) && node.style.fontWeight !== 'normal' ? null : false),
        },
github ifiokjr / remirror / @remirror / core-extensions / src / nodes / ordered-list-extension.ts View on Github external
getAttrs: node => {
            if (!isElementDOMNode(node)) {
              return {};
            }

            return {
              order: +(node.getAttribute('start') ?? 1),
            };
          },
        },