Closed taktran closed 1 year ago
This matches my understanding, also – we've just been caught by this when debugging a piece of functionality w/ prosemirror-devtools.
(Lovely tool, btw. So useful for us at https://github.com/guardian, esp. when onboarding new developers.)
Hi,
It seems like the text node start position is supposed to be 1 more than it is.
In the above image, I think
text
should start at20
instead of19
.From the code, blocks increment by 1 for
startPos
https://github.com/d4rkr00t/prosemirror-dev-tools/blob/c2d0ff4f1d9b66110d876340aa9def76cd096685/src/tabs/structure.js#L96
but
text
blocks don't ie,https://github.com/d4rkr00t/prosemirror-dev-tools/blob/c2d0ff4f1d9b66110d876340aa9def76cd096685/src/tabs/structure.js#L116
Here is an example of a document in action where the
paragraph
is position0
and the text inside is position1
:https://runkit.com/taktran/prosemirror-nodesbetween
Is there a reason for this? I might be missing something, as I'm quite new to prosemirror :)