Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
get schema(): NodeExtensionSpec {
return {
content: 'inline*',
group: NodeGroup.Block,
attrs: this.extraAttrs(),
draggable: false,
parseDOM: [
{
tag: 'p',
getAttrs: node => this.getExtraAttrs(node as Element),
},
],
toDOM: () => ['p', 0],
};
}
}
group: 'inline',
atom: true,
selectable: true,
parseDOM: [
{
tag: 'span[data-node-type="atomInline"]',
},
],
toDOM: () => {
return ['span', { 'data-node-type': 'atomInline' }];
},
};
const atomBlock: NodeSpec = {
inline: false,
group: NodeGroup.Block,
atom: true,
selectable: true,
parseDOM: [
{
tag: 'div[data-node-type="atomBlock"]',
},
],
toDOM: () => {
return ['div', { 'data-node-type': 'atomBlock' }];
},
};
const atomContainer: NodeSpec = {
inline: false,
group: NodeGroup.Block,
content: 'atomBlock+',
group: NodeGroup.Block,
atom: true,
selectable: true,
parseDOM: [
{
tag: 'div[data-node-type="atomBlock"]',
},
],
toDOM: () => {
return ['div', { 'data-node-type': 'atomBlock' }];
},
};
const atomContainer: NodeSpec = {
inline: false,
group: NodeGroup.Block,
content: 'atomBlock+',
parseDOM: [
{
tag: 'div[data-node-type="atomBlockContainer"]',
},
],
toDOM: () => {
return ['div', { 'data-node-type': 'atomBlockContainer' }];
},
};
const containerWithRestrictedContent: NodeSpec = {
inline: false,
group: NodeGroup.Block,
content: 'paragraph+',
parseDOM: [