Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
import {DOMSerializer, DOMParser} from 'prosemirror-model';
import ElementSchema from './elementSchema';
import {schema} from './schema';
const markSerializer = DOMSerializer.marksFromSchema(schema);
const nodeSerializer = DOMSerializer.nodesFromSchema(schema);
nodeSerializer.block_embed = function toDOM(node) {
return ElementSchema.serializeNode(node);
};
nodeSerializer.embed = function toDOM(node) {
return ElementSchema.serializeNode(node);
};
const clipboardSerializer = new DOMSerializer(nodeSerializer, markSerializer);
const defaultRules = DOMParser.schemaRules(schema);
const getNodeAttrs = (dom) => {
const nodeId = dom.getAttribute('data-nodeId');
const configureClipboard = ({schema}) => {
const markSerializer = DOMSerializer.marksFromSchema(schema);
const nodeSerializer = DOMSerializer.nodesFromSchema(schema);
/*
nodeSerializer.block_embed = function toDOM(node) {
return null;
};
nodeSerializer.embed = function toDOM(node) {
return null;
};
*/
const clipboardSerializer = new DOMSerializer(nodeSerializer, markSerializer);
const defaultRules = DOMParser.schemaRules(schema);
const transformPastedHTML = function(htmlStr) {
return htmlStr;