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:
@@ -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,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
],
|
},
|
||||||
}
|
}
|
||||||
|
@@ -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,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
],
|
},
|
||||||
}
|
}
|
||||||
|
@@ -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) {
|
||||||
|
Reference in New Issue
Block a user