Switch to blocks/inlines from marks - #4
Conversation
| ), | ||
| line: ({ attributes, children }) => ( | ||
| <span {...attributes}>{children}</span> | ||
| ), |
There was a problem hiding this comment.
This part shouldn't be necessary if we got inlines to work for mentions.
|
I feel like If that doesn't help, I'll be happy to take a look at why |
|
Please do take a look, I've unsuccessfully tried to make this work for too long! I must be missing something minor, but this feels like an |
|
Here is how far I reached: https://github.com/oyeanuj/slate-mentions/tree/switch-to-blocks I see some issues with It also seems like just wrapping inline, and then moving it back to start of selection is leading to an error:
But, its a start.. |
This PR switches
mentionsto be blocks. This is necessary to be able to position the suggestion portal right next to the mention.The problem with this PR is that getting this to work correctly requires us to override the
lineanddefaultnodes to bespans, which is obviously not optimal:tm: as it'll break a bunch of folks editors.I tried using
setInline/splitInline/... instead ofsetBlock/... but for some reason that didn't do anything. Maybe @ianstormtaylor has an idea why this exact change withxInlinerather thanxBlockdoesn't work?/cc @oyeanuj