@atlaskit/editor-plugin-block-menu
Version:
BlockMenu plugin for @atlaskit/editor-core
18 lines (17 loc) • 578 B
JavaScript
;
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.removeDisallowedMarks = void 0;
/**
* 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.
*/
var removeDisallowedMarks = exports.removeDisallowedMarks = function removeDisallowedMarks(nodes, targetNode) {
return nodes.map(function (node) {
return node.mark(targetNode.allowedMarks(node.marks));
});
};