I'm trying to create scayt-like functionality where the HTML markup is sent to a server, analyzed, and the returned result is a set of xpaths and offsets that represent the text that must be marked up. However, I can't seem to use the result to create a range with an offset from the root container using createRange, setStart and setEnd. I'm getting an "Uncaught IndexSizeError: Failed to execute 'setStart' on 'Range': There is no child at offset". However, when I get the textContent of the node, it is longer than the offset. What is the accepted way of taking a path and offset and marking up the content? Should I be adding the markup tags on the server and loading the modified content into the editor?
Mon, 12/22/2014 - 23:56
#1