Hi!
There is the an inclusive
property for marks, but I wonder if there is the same behavior for an inline node ? I tried to do the same behavior with inputRule
but without success. Have you an idea to do that ?
Hi!
There is the an inclusive
property for marks, but I wonder if there is the same behavior for an inline node ? I tried to do the same behavior with inputRule
but without success. Have you an idea to do that ?
Inline nodes with content are problematic because browsers do not distinguish between cursor positions inside and outside such a node, yet those positions have different ProseMirror document position values. The library does not try to define this behavior, because there is no real good way to do it. Avoid using such nodes if at all possible.
Thanks for your advice! I will try to use a mark instead.
@marijn I assume you mean with text content? So in other words inlines are primarily suitable for the same case as seen in the demo where they display something, like a picture of a dinosaur?
Right ā content as in the content
field of the spec. Though of course having them have content but render as atomic nodes that are edited via some other means than the regular text also works.
In my case, Iām using prosemirror to output markdown component. A spec of MDC is to write span text
.
This type of Vue component can be written anywhere inline in a paragraph and can contains only marks. The main purpose of this component is for styling text.
It seems a good candidate for inline node. I implemented in this way, but I have some weird behavior with the cursor position or selection. Do you think I should consider using mark instead ?
Yes, that looks like it could be modeled well as a mark.