Closed nickatrons closed 5 years ago
It's likely the highlights. The built-in Store plugin removes those when serializing: https://github.com/openannotation/annotator/blob/v1.2.x/src/plugin/store.coffee#L461
Yeah, had to remove them too. Just kinda annoying, so wanted to hear if this was intended :)
This is the intended behavior.
Hi, so I'm making a plugin to 1.2.10 of annotatorjs. I want to get the annotation object and send it to my nodejs server for storage.
But, when I use $.post or $.ajax it throws back
RangeError {type: "start", message: "Error while finding start node: undefined: TypeError: Cannot read property 'substring' of undefined", parent: TypeError: Cannot read property 'substring' of undefined at Object.Util.nodeFromXPath
This I can somewhat handle with
var serializedData = JSON.stringify(data); var trueJson = JSON.parse(serializedData);
I assume this is because something in the annotation objects Range and Highlights is calling this method. I dont understand why. Am I missing something?