prosemirror-dev-tools
prosemirror-dev-tools copied to clipboard
Text node start positions off by 1?
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 at 20
instead of 19
.
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 position 0
and the text inside is position 1
:
https://runkit.com/taktran/prosemirror-nodesbetween
Is there a reason for this? I might be missing something, as I'm quite new to prosemirror :)
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.)