openannotation / annotator

Annotation tools for the web. Select text, images, or (nearly) anything else, and add your notes.
http://annotatorjs.org
Other
2.67k stars 532 forks source link

i cannot see highlight tags on screen when i loaded annotators (json format) #723

Open cuiwang opened 11 months ago

cuiwang commented 11 months ago

hello,I was used annotator v2.0.3 in a base vue2 application, but a bug(maybe) confused me. i got a RangeError{type: "start", message: "Couldn't find start node: /div[1]/div[2]/span[222]", parent: null}.

first: i defined MyLocalStorage (mostly like node_modules/annotator/src/storage.js:function:: debug() )

partly code:
// tempArr : {quote: "建筑技术", ranges: Array(1), custom: "custom", text: "123", tags: Array(0), …}
query: function (queryObj) {
            return {results:tempArr};
        }

second:

this.annotatorApp.start().then(() => {
        this.annotatorApp.annotations.load()
      })

finally:

i got this in highlighter.js , function reanchorRange :

RangeError {type: "start", message: "Couldn't find start node: /div[1]/div[2]/span[222]", parent: null}

so, how can i correct restore localstorage annotators on screen?