Hi, guys!
I have such kind of schema types:
- Paragraph (text input block)
export default {
group: 'block',
content: 'inline*',
parseDOM: [
{ tag: 'p' },
],
toDOM() {
return [
'p',
{},
0,
];
},
}
- Iframe
export default {
group: 'block',
content: 'block',
attrs: {
src: {},
},
parseDOM: [
{ tag: 'iframe' },
],
toDOM(node) {
const { src } = node.attrs;
return [
'iframe',
{ src },
0,
];
},
};
I try to create a new schema type by using these types. What I have:
export default {
group: 'block',
content: 'iframe paragraph',
attrs: {
src: {},
},
parseDOM: [
{ tag: 'div' },
],
toDOM(node) {
const { src } = node.attrs;
return [
'div',
[
'iframe',
{ src },
],
[
'paragraph',
],
];
},
};
And this is my result:
The iframe is inserted correctly. But instead of the paragraph (text input block) I get the “paragraph” tag
What do I do incorrectly?
I’d be glad to get your help! Thanks!