1
0
mirror of https://github.com/ianstormtaylor/slate.git synced 2025-08-06 07:17:27 +02:00

fix annotations toJSON to return an object

This commit is contained in:
Ian Storm Taylor
2019-05-08 20:42:00 -07:00
parent 5bdcbc4d83
commit 1036503f34
3 changed files with 7 additions and 7 deletions

View File

@@ -49,8 +49,8 @@ export const output = {
}, },
], ],
}, },
annotations: [ annotations: {
{ '0': {
key: '0', key: '0',
object: 'annotation', object: 'annotation',
type: 'highlight', type: 'highlight',
@@ -68,5 +68,5 @@ export const output = {
offset: 6, offset: 6,
}, },
}, },
], },
} }

View File

@@ -66,8 +66,8 @@ export const output = {
}, },
], ],
}, },
annotations: [ annotations: {
{ a: {
object: 'annotation', object: 'annotation',
key: 'a', key: 'a',
type: 'highlight', type: 'highlight',
@@ -85,5 +85,5 @@ export const output = {
offset: 2, offset: 2,
}, },
}, },
], },
} }

View File

@@ -868,8 +868,8 @@ class Value extends Record(DEFAULTS) {
if (options.preserveAnnotations) { if (options.preserveAnnotations) {
object.annotations = this.annotations object.annotations = this.annotations
.toArray()
.map(a => a.toJSON(options)) .map(a => a.toJSON(options))
.toObject()
} }
if (options.preserveSelection) { if (options.preserveSelection) {