Create node to handle title and body editable (multiple holes)

Hi, I was searching and searching but I couldn’t find how to do this case. Maybe you can help me to find a solution.

Peek 17-03-2020 18-03

Process:

  1. Select node from toolbar and add the node to the editor
  2. Focus on title (h3)
  3. When press enter, focus in paragraph
  4. If press 2 times enter, then show again the placeholder to enter a title for a new section
  5. If press enter without writing anything in the title, just hide and show body

I was reasearching multiple holes in the schema but I couldn make it work.

Can you provide me with some advise or solution to acomplish this goal?

Thanks!!

If you want a schema with multiple holes to handle things like having a title and a body, make a container node that can hold multiple blocks, e.g.

  get schema() {
    return {
      content: "title block+",
    };
  }
// title
  get schema() {
    return {
      content: "inline*",
      parseDOM: [{tag: "h1"}],
      toDOM: node => ["h1", {class: "title"}, 0],
    };
  }