Skip to content

children of my custom node are ignored... why? #5557

Closed Answered by nperez0111
silenius asked this question in Questions & Help
Discussion options

You must be logged in to vote

You didn't add a "hole" for your content to be rendered into.

Try this:

export const FlexContainer = Node.create({
    name: 'flexContainer',
    content: 'block*',
    group: 'block',
    inline: false,
    draggable: true,
    selectable: true,
    
    addOptions() {
        return {
            HTMLAttributes: {}
        }
    },
    
    parseHTML() {
        return [
            {
                tag: 'div',
                getAttrs: element => element.classList.contains('flex') && null
            },
        ]
    },

    renderHTML({ node, HTMLAttributes }) {
        return [
            'div', 
            mergeAttributes(
                HTMLAttributes, {
                    'cl…

Replies: 2 comments

Comment options

You must be logged in to vote
0 replies
Answer selected by nperez0111
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants