Merge pull request #31524 from misspia/master

[slate.js] Add 'object' fields to slate's LeafJSON and MarkJSON
This commit is contained in:
Wesley Wigham
2018-12-24 21:44:34 -08:00
committed by GitHub
2 changed files with 5 additions and 1 deletions
+2
View File
@@ -327,6 +327,7 @@ export interface LeafProperties {
export interface LeafJSON {
marks?: MarkJSON[];
text?: string;
object: "leaf";
}
export class Leaf extends Immutable.Record({}) {
@@ -521,6 +522,7 @@ export interface MarkProperties {
export interface MarkJSON {
type: string;
data?: { [key: string]: any };
object: "mark";
}
export class Mark extends Immutable.Record({}) {
+3 -1
View File
@@ -12,10 +12,12 @@ const node: BlockJSON = {
key: "a",
leaves: [
{
object: "leaf",
text: "example",
marks: [{
data: { testData: "data"},
type: "mark"
type: "mark",
object: "mark"
}]
}
]