diff --git a/src/json-crdt-extensions/peritext/overlay/__tests__/Overlay.spec.ts b/src/json-crdt-extensions/peritext/overlay/__tests__/Overlay.spec.ts index 05d2f89ce7..a770d0cb27 100644 --- a/src/json-crdt-extensions/peritext/overlay/__tests__/Overlay.spec.ts +++ b/src/json-crdt-extensions/peritext/overlay/__tests__/Overlay.spec.ts @@ -186,7 +186,6 @@ describe('slices', () => { expect(point3.layers[1].data()).toStrictEqual({bold: true}); const point4 = next(point3)!; expect(point4.layers.length).toBe(0); - console.log(peritext + ''); }); test('one char slice should correctly sort overlay points', () => { diff --git a/src/json-crdt-extensions/peritext/slice/Cursor.ts b/src/json-crdt-extensions/peritext/slice/Cursor.ts index 0213522bf8..8d1ab3e45a 100644 --- a/src/json-crdt-extensions/peritext/slice/Cursor.ts +++ b/src/json-crdt-extensions/peritext/slice/Cursor.ts @@ -101,9 +101,9 @@ export class Cursor extends Range implements Slice { // ---------------------------------------------------------------- Printable public toString(tab: string = ''): string { - const text = JSON.stringify(this.text()); + const text = this.text(); const focusIcon = this.anchorSide === CursorAnchor.Start ? '.→|' : '|←.'; const main = `${this.constructor.name} ${super.toString(tab + ' ', true)} ${focusIcon}`; - return main + printTree(tab, [() => text]); + return main + (text.length > 32 ? printTree(tab, [() => JSON.stringify(text)]) : ''); } }