mirror of
https://github.com/ianstormtaylor/slate.git
synced 2025-08-06 15:26:34 +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',
|
||||
object: 'annotation',
|
||||
type: 'highlight',
|
||||
@@ -68,5 +68,5 @@ export const output = {
|
||||
offset: 6,
|
||||
},
|
||||
},
|
||||
],
|
||||
},
|
||||
}
|
||||
|
@@ -66,8 +66,8 @@ export const output = {
|
||||
},
|
||||
],
|
||||
},
|
||||
annotations: [
|
||||
{
|
||||
annotations: {
|
||||
a: {
|
||||
object: 'annotation',
|
||||
key: 'a',
|
||||
type: 'highlight',
|
||||
@@ -85,5 +85,5 @@ export const output = {
|
||||
offset: 2,
|
||||
},
|
||||
},
|
||||
],
|
||||
},
|
||||
}
|
||||
|
@@ -868,8 +868,8 @@ class Value extends Record(DEFAULTS) {
|
||||
|
||||
if (options.preserveAnnotations) {
|
||||
object.annotations = this.annotations
|
||||
.toArray()
|
||||
.map(a => a.toJSON(options))
|
||||
.toObject()
|
||||
}
|
||||
|
||||
if (options.preserveSelection) {
|
||||
|
Reference in New Issue
Block a user