client/src/api/WebAnnotationSerializer.js
changeset 102 b0e36664f1f2
parent 100 6fd752d98933
child 129 d48946d164c6
--- a/client/src/api/WebAnnotationSerializer.js	Wed Jun 28 12:54:48 2017 +0200
+++ b/client/src/api/WebAnnotationSerializer.js	Wed Jun 28 13:29:07 2017 +0200
@@ -27,13 +27,21 @@
         annotation = Object.assign({}, annotation, { body })
       }
 
+      const selectors = [
+        {
+          "type": "TextQuoteSelector",
+          "exact": category.text,
+        }, {
+          "type": "TextPositionSelector",
+          "start": category.selection.start,
+          "end": category.selection.end,
+        }
+      ]
+
       return Object.assign({}, annotation, {
         "target": {
           "source": source,
-          "selector": {
-            "type": "TextQuoteSelector",
-            "exact": category.text,
-          }
+          "selector": selectors
         }
       })
     });