From 34f57ed7d3297773be3895f6dfccd768d7316e33 Mon Sep 17 00:00:00 2001 From: Brian Hung Date: Mon, 27 Jun 2022 10:52:08 -0700 Subject: [PATCH] join text nodes with the same marks when deserializing fragment from json --- src/fragment.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/fragment.ts b/src/fragment.ts index 731e606..0eaf0e4 100644 --- a/src/fragment.ts +++ b/src/fragment.ts @@ -223,7 +223,7 @@ export class Fragment { static fromJSON(schema: Schema, value: any) { if (!value) return Fragment.empty if (!Array.isArray(value)) throw new RangeError("Invalid input for Fragment.fromJSON") - return new Fragment(value.map(schema.nodeFromJSON)) + return Fragment.fromArray(value.map(schema.nodeFromJSON)) } /// Build a fragment from an array of nodes. Ensures that adjacent