@sacha, you are absolutely correct. I did manage to get it working using textContent, by iterating over all nodes and resolving their position in the document, then using their start position to map it onto the textContent offsets. It is heavy and definitely not the best approach though. Once I’ve found the right approach, I’ll be sure to post it here for anyone facing a similar issue.