Ignoring marks inside a node when coming from outside

Hey! I’m trying to implement an editor with footnotes. The core of the implementation is the footnote demo. However, my implementation has one of the same problems of the demo: when selecting around the footnote reference and toggling a mark, it gets toggled in all of the footnote’s content.

After thinking a lot about it, I think the only approach is to re-implement footnotes with the references being decoupled from the content. I’ve thought about hacks to make it work but it would be way too complex and fragile (and even then, the connection with the inner editor seems fragile too.)

Has anyone done something similar?

Curvenote seems to have the same issue.

Related issue on the demo.

Similarly to the disappointing approach suggested for children nodes, we could define a separate set of marks (e.g. strong and footnote_strong) and only allow those inside footnotes. Then, when detecting we’re focused inside of a footnote, switch to that version. I don’t really want to do that, though.