@atlaskit/editor-plugin-block-menu
Version:
BlockMenu plugin for @atlaskit/editor-core
12 lines • 433 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 var removeDisallowedMarks = function removeDisallowedMarks(nodes, targetNode) {
return nodes.map(function (node) {
return node.mark(targetNode.allowedMarks(node.marks));
});
};