I am building a restful api in php to use annotator js to store annotations
in my own mysql database.
When I create an annotation across paragraphs, I get the json shown below :
 
{"ranges":[{"start":"/p[1]","startOffset":0,"end":"/p[2]","endOffset":10}],"quote":"hjshdjkhfjkhcncjkhjfdhfjhdjfkjfjdhkfjhdf\\n\\t\\t\\n\\t\\t\\n\\t\\thjhcnjxcnj","text":"hjs","uri":"/annotations/api"},
referer: http://localhost/case/1

I store this json in mysql database. When I retrieve this annotation on a
GET request, I get the json given below with the error "Sorry we could not
search the store" :
 
{"rows":[{"ranges":[{"start":"/p[1]","startOffset":0,"end":"/p[2]","endOffset":10}],"quote":"hjshdjkhfjkhcncjkhjfdhfjhdjfkjfjdhkfjhdf\n\t\t\n\t\t\n\t\thjhcnjxcnj","text":"hjs","uri":"/annotations/api","id":1438239063}]},
referer: http://localhost/case/1

Annotator expects \\n instead of \n. But mysql escapes it, giving \n on
retrieval. How do I solve this problem? Kindly help.

Thank you!
_______________________________________________
annotator-dev mailing list
annotator-dev@lists.okfn.org
https://lists.okfn.org/mailman/listinfo/annotator-dev
Unsubscribe: https://lists.okfn.org/mailman/options/annotator-dev

Reply via email to