@atlaskit/editor-plugin-block-menu
Version:
BlockMenu plugin for @atlaskit/editor-core
10 lines • 382 B
JavaScript
/**
* Removes all disallowed marks from a node based on the target node type.
*
* @param node - The node to remove marks from.
* @param targetNode - The target node type to check against.
* @returns The nodes with the marks removed.
*/
export const removeDisallowedMarks = (nodes, targetNode) => {
return nodes.map(node => node.mark(targetNode.allowedMarks(node.marks)));
};