Ban marks inside code_block

Hi! I have a schema

    nodes: {
        doc: { content: 'block+' },
        paragraph: {
            content: 'inline*',
            group: 'block',
            parseDOM: [{ tag: 'p' }],
            toDOM() {
                return ['p', 0];
            },
        },
        blockquote: {
            content: 'paragraph+',
            group: 'block',
            defining: true,
            parseDOM: [{ tag: 'blockquote' }],
            toDOM() {
                return blockquoteDOM;
            },
        } as NodeSpec,
        code_block: {
            content: 'paragraph+',
            marks: '',
            group: 'block',
            code: true,
            defining: true,
            parseDOM: [{ tag: 'pre', preserveWhitespace: 'full' }],
            toDOM() {
                return preDOM;
            },
        } as NodeSpec,
        text: { group: 'inline' },
        emoji: EMOJI_NODE_SPEC,
        mention: MENTION_NODE_SPEC,
        hard_break: MULTILINE_NODE_SPEC,
    },
    marks,

as you can see my code_block have paragraphs which can have marks. I wrote marks: “” inside code_block but it does not work. I think that this happens because paragraphs can have marks. Is it possible to completely ban marks inside paragraphs in the code_block?

The marks option only determines what marks direct children of that node can have.

It is atypical to have paragraphs inside code blocks. The usual approach is to just have text* and use newlines (because code isn’t organized with paragraphs and hard breaks). But if you really must, you could use a separate type of paragraph-ish node in your code block, and forbid marks inside of that.