Skip to content

I can't input text append a mark that output nested DOM  #1232

@ocavue

Description

@ocavue

I have a mark that returns nested DOM in its toDOM. I found that I can't input text after this mark. The input text is shown on the screen but it's not inserted into ProseMirror's data structure.

      toDOM: mark => [
        "span",
        {
          class: "markaaa",
          style: "background-color: lightgreen;"
        },
        [
          "a",
          {
            href: "https://google.com"
          },
          0
        ]
      ]

I'm not sure if it's allowed to output nested DOM structure in a mark's toDOM, but I didn't find any limit about this from the document.

mini repo: https://glitch.com/edit/#!/bow-steadfast-accelerator?path=index.js%3A6%3A49

CleanShot.2021-12-30.at.17.04.57.mp4

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions