From 8096761a9728a7c29b27bab037e7f59244ab8f3b Mon Sep 17 00:00:00 2001 From: Ian Storm Taylor Date: Fri, 2 Dec 2016 13:09:24 -0800 Subject: [PATCH] fix lots of tests with inline behavior --- src/models/node.js | 6 ----- .../fixtures/custom-inline/input.yaml | 4 ++++ .../fixtures/custom-inline/output.html | 10 ++++++++ .../default-block-and-inline/input.yaml | 4 ++++ .../default-block-and-inline/output.html | 10 ++++++++ .../multiple-custom-inline/input.yaml | 6 +++++ .../multiple-custom-inline/output.html | 15 ++++++++++++ .../deserialize/inline-nested/output.yaml | 4 ++++ .../deserialize/inline-with-data/output.yaml | 2 ++ .../html/deserialize/inline/output.yaml | 24 ++++++++++--------- .../inline-nested/output.yaml | 4 ++++ .../inline-with-data/output.yaml | 2 ++ .../raw/deserialize-terse/inline/output.yaml | 2 ++ .../raw/deserialize/inline-nested/output.yaml | 4 ++++ .../deserialize/inline-with-data/output.yaml | 2 ++ .../raw/deserialize/inline/output.yaml | 2 ++ .../serialize-terse/inline-nested/output.yaml | 8 +++++++ .../inline-with-data/output.yaml | 4 ++++ .../raw/serialize-terse/inline/output.yaml | 4 ++++ .../raw/serialize/inline-nested/output.yaml | 20 ++++++++++++++++ .../serialize/inline-with-data/output.yaml | 10 ++++++++ .../fixtures/raw/serialize/inline/output.yaml | 10 ++++++++ .../delete/across-blocks-inlines/index.js | 8 +++---- .../delete/across-blocks-inlines/input.yaml | 8 +++++++ .../delete/across-blocks-inlines/output.yaml | 6 +++++ .../index.js | 10 ++++---- .../input.yaml | 8 +++++++ .../output.yaml | 8 +++++++ .../add-mark-at-range/across-inlines/index.js | 8 +++---- .../across-inlines/input.yaml | 8 +++++++ .../across-inlines/output.yaml | 8 +++++++ .../across-blocks-inlines/index.js | 8 +++---- .../across-blocks-inlines/input.yaml | 8 +++++++ .../across-blocks-inlines/output.yaml | 6 +++++ .../before-inline-sibling/output.yaml | 2 ++ .../delete-at-range/whole-inline/index.js | 8 +++---- .../delete-at-range/whole-inline/input.yaml | 4 ++++ .../before-inline-sibling/output.yaml | 2 ++ .../before-inline-sibling/output.yaml | 2 ++ .../end-inline/index.js | 10 ++++---- .../end-inline/input.yaml | 4 ++++ .../end-inline/output.yaml | 2 ++ .../middle-inline-fragment-inline/index.js | 6 ++--- .../middle-inline-fragment-inline/input.yaml | 4 ++++ .../middle-inline-fragment-inline/output.yaml | 8 +++++++ .../middle-inline/index.js | 6 ++--- .../middle-inline/input.yaml | 4 ++++ .../middle-inline/output.yaml | 4 ++++ .../start-inline/index.js | 6 ++--- .../start-inline/input.yaml | 4 ++++ .../start-inline/output.yaml | 2 ++ .../inside-inline/index.js | 6 ++--- .../inside-inline/input.yaml | 4 ++++ .../inside-inline/output.yaml | 4 ++++ .../across-inlines/index.js | 8 +++---- .../across-inlines/input.yaml | 8 +++++++ .../across-inlines/output.yaml | 8 +++++++ .../across-inlines/index.js | 8 +++---- .../across-inlines/input.yaml | 8 +++++++ .../across-inlines/output.yaml | 8 +++++++ .../across-inlines/index.js | 8 +++---- .../across-inlines/input.yaml | 8 +++++++ .../across-inlines/output.yaml | 8 +++++++ .../set-inline-at-range/data-only/index.js | 6 ++--- .../set-inline-at-range/data-only/input.yaml | 4 ++++ .../set-inline-at-range/data-only/output.yaml | 4 ++++ .../nested-inline/index.js | 6 ++--- .../nested-inline/input.yaml | 8 +++++++ .../nested-inline/output.yaml | 8 +++++++ .../single-inline-string-shorthand/index.js | 6 ++--- .../single-inline-string-shorthand/input.yaml | 4 ++++ .../output.yaml | 4 ++++ .../single-inline/index.js | 6 ++--- .../single-inline/input.yaml | 4 ++++ .../single-inline/output.yaml | 4 ++++ .../with-data-object/index.js | 6 ++--- .../with-data-object/input.yaml | 4 ++++ .../with-data-object/output.yaml | 4 ++++ .../set-inline-at-range/with-data/index.js | 6 ++--- .../set-inline-at-range/with-data/input.yaml | 4 ++++ .../set-inline-at-range/with-data/output.yaml | 4 ++++ .../set-inline-at-range/with-is-void/index.js | 6 ++--- .../with-is-void/input.yaml | 4 ++++ .../index.js | 8 +++---- .../input.yaml | 8 +++++++ .../output.yaml | 8 +++++++ .../split-block-at-range/with-inline/index.js | 6 ++--- .../with-inline/input.yaml | 4 ++++ .../with-inline/output.yaml | 8 +++++++ .../split-inline-at-range/block-end/index.js | 10 ++++---- .../block-end/input.yaml | 4 ++++ .../block-end/output.yaml | 4 ++++ .../block-middle/index.js | 6 ++--- .../block-middle/input.yaml | 4 ++++ .../block-middle/output.yaml | 6 +++++ .../block-start/index.js | 6 ++--- .../block-start/input.yaml | 4 ++++ .../block-start/output.yaml | 4 ++++ .../split-inline-at-range/depth/index.js | 6 ++--- .../split-inline-at-range/depth/input.yaml | 8 +++++++ .../split-inline-at-range/depth/output.yaml | 10 ++++++++ .../with-delete/index.js | 6 ++--- .../with-delete/input.yaml | 4 ++++ .../with-delete/output.yaml | 6 +++++ .../split-inline-at-range/with-marks/index.js | 6 ++--- .../with-marks/input.yaml | 4 ++++ .../with-marks/output.yaml | 6 +++++ .../add-across-inlines/index.js | 8 +++---- .../add-across-inlines/input.yaml | 8 +++++++ .../add-across-inlines/output.yaml | 8 +++++++ .../remove-across-inlines/index.js | 8 +++---- .../remove-across-inlines/input.yaml | 8 +++++++ .../remove-across-inlines/output.yaml | 8 +++++++ .../across-inlines/index.js | 8 +++---- .../across-inlines/input.yaml | 8 +++++++ .../across-inlines/output.yaml | 8 +++++++ .../across-blocks/input.yaml | 4 ++++ .../across-inlines/index.js | 8 +++---- .../across-inlines/input.yaml | 18 ++++++++++++++ .../across-inlines/output.yaml | 10 ++++++++ .../with-object/index.js | 4 ++-- .../with-object/input.yaml | 4 ++++ .../across-inlines/index.js | 8 +++---- .../across-inlines/input.yaml | 8 +++++++ .../across-inlines/output.yaml | 8 +++++++ .../across-blocks/output.yaml | 4 ++++ .../across-inlines/index.js | 8 +++---- .../across-inlines/input.yaml | 6 +++++ .../across-inlines/output.yaml | 14 +++++++++++ .../wrap-inline-void/output.yaml | 4 ++++ .../across-inlines/index.js | 8 +++---- .../across-inlines/input.yaml | 6 +++++ .../across-inlines/output.yaml | 6 +++++ .../by-key/join-node-by-key/text/output.yaml | 2 ++ .../by-key/move-node-by-key/inline/index.js | 2 +- .../by-key/move-node-by-key/inline/input.yaml | 6 +++++ .../move-node-by-key/inline/output.yaml | 6 +++++ .../by-key/remove-node-by-key/inline/index.js | 2 +- .../remove-node-by-key/inline/input.yaml | 4 ++++ .../adjacent-non-void-inlines/index.js | 6 ++--- .../adjacent-non-void-inlines/input.yaml | 4 ++++ .../adjacent-non-void-inlines/output.yaml | 6 +++++ .../inline-last-character-deep/index.js | 6 ++--- .../inline-last-character-deep/input.yaml | 8 +++++++ .../inline-last-character/index.js | 6 ++--- .../inline-last-character/input.yaml | 4 ++++ .../by-key/remove-text-by-key/inline/index.js | 4 ++-- .../remove-text-by-key/inline/input.yaml | 4 ++++ .../remove-text-by-key/inline/output.yaml | 4 ++++ .../next-void-inline/index.js | 6 ++--- .../next-void-inline/input.yaml | 2 ++ .../next-void-inline/output.yaml | 4 ++++ .../previous-void-inline/input.yaml | 2 ++ .../previous-void-inline/output.yaml | 4 ++++ .../single-block/input.yaml | 2 ++ .../single-block/output.yaml | 2 ++ .../wrap-block-by-key/block-node/input.yaml | 7 +----- .../wrap-block-by-key/block-node/output.yaml | 5 ---- .../wrap-block-by-key/text-node/input.yaml | 7 +----- .../wrap-block-by-key/text-node/output.yaml | 5 ---- 160 files changed, 800 insertions(+), 183 deletions(-) diff --git a/src/models/node.js b/src/models/node.js index e9d8e82ba..ddebb8719 100644 --- a/src/models/node.js +++ b/src/models/node.js @@ -1003,13 +1003,7 @@ const Node = { return this .getTexts() .find((text, i, texts) => { - const next = texts.get(i + 1) length += text.length - - // If the next text is an empty string, return false, because we want - // the furthest text node at the offset, and it will also match. - if (next && next.length == 0) return false - return length > offset }) }, diff --git a/test/rendering/fixtures/custom-inline/input.yaml b/test/rendering/fixtures/custom-inline/input.yaml index bb0a47aed..50148ac2e 100644 --- a/test/rendering/fixtures/custom-inline/input.yaml +++ b/test/rendering/fixtures/custom-inline/input.yaml @@ -3,6 +3,8 @@ nodes: - kind: block type: default nodes: + - kind: text + text: "" - kind: inline type: link data: @@ -11,3 +13,5 @@ nodes: - kind: text ranges: - text: word + - kind: text + text: "" diff --git a/test/rendering/fixtures/custom-inline/output.html b/test/rendering/fixtures/custom-inline/output.html index 742f1d611..073d3d3d3 100644 --- a/test/rendering/fixtures/custom-inline/output.html +++ b/test/rendering/fixtures/custom-inline/output.html @@ -1,10 +1,20 @@
+ + + + + word + + + + +
diff --git a/test/rendering/fixtures/default-block-and-inline/input.yaml b/test/rendering/fixtures/default-block-and-inline/input.yaml index 353b1de1f..3da77646d 100644 --- a/test/rendering/fixtures/default-block-and-inline/input.yaml +++ b/test/rendering/fixtures/default-block-and-inline/input.yaml @@ -3,9 +3,13 @@ nodes: - kind: block type: default nodes: + - kind: text + text: "" - kind: inline type: default nodes: - kind: text ranges: - text: word + - kind: text + text: "" diff --git a/test/rendering/fixtures/default-block-and-inline/output.html b/test/rendering/fixtures/default-block-and-inline/output.html index 8d32ae8da..9546bc3eb 100644 --- a/test/rendering/fixtures/default-block-and-inline/output.html +++ b/test/rendering/fixtures/default-block-and-inline/output.html @@ -1,10 +1,20 @@
+ + + + + word + + + + +
diff --git a/test/rendering/fixtures/multiple-custom-inline/input.yaml b/test/rendering/fixtures/multiple-custom-inline/input.yaml index 8bdbdc47a..13d44f40f 100644 --- a/test/rendering/fixtures/multiple-custom-inline/input.yaml +++ b/test/rendering/fixtures/multiple-custom-inline/input.yaml @@ -3,6 +3,8 @@ nodes: - kind: block type: default nodes: + - kind: text + text: "" - kind: inline type: link data: @@ -11,6 +13,8 @@ nodes: - kind: text ranges: - text: another + - kind: text + text: "" - kind: inline type: link data: @@ -19,3 +23,5 @@ nodes: - kind: text ranges: - text: word + - kind: text + text: "" diff --git a/test/rendering/fixtures/multiple-custom-inline/output.html b/test/rendering/fixtures/multiple-custom-inline/output.html index bdfb2a371..e63aec31b 100644 --- a/test/rendering/fixtures/multiple-custom-inline/output.html +++ b/test/rendering/fixtures/multiple-custom-inline/output.html @@ -1,15 +1,30 @@
+ + + + + another + + + + + word + + + + +
diff --git a/test/serializers/fixtures/html/deserialize/inline-nested/output.yaml b/test/serializers/fixtures/html/deserialize/inline-nested/output.yaml index 6cc09ef75..5c5af1b31 100644 --- a/test/serializers/fixtures/html/deserialize/inline-nested/output.yaml +++ b/test/serializers/fixtures/html/deserialize/inline-nested/output.yaml @@ -4,10 +4,12 @@ nodes: isVoid: false data: {} nodes: + - characters: [] - type: link isVoid: false data: {} nodes: + - characters: [] - type: hashtag isVoid: false data: {} @@ -19,3 +21,5 @@ nodes: marks: [] - text: e marks: [] + - characters: [] + - characters: [] diff --git a/test/serializers/fixtures/html/deserialize/inline-with-data/output.yaml b/test/serializers/fixtures/html/deserialize/inline-with-data/output.yaml index 126ef10f5..78875cd0b 100644 --- a/test/serializers/fixtures/html/deserialize/inline-with-data/output.yaml +++ b/test/serializers/fixtures/html/deserialize/inline-with-data/output.yaml @@ -4,6 +4,7 @@ nodes: isVoid: false data: {} nodes: + - characters: [] - type: link isVoid: false data: @@ -16,3 +17,4 @@ nodes: marks: [] - text: e marks: [] + - characters: [] diff --git a/test/serializers/fixtures/html/deserialize/inline/output.yaml b/test/serializers/fixtures/html/deserialize/inline/output.yaml index 963558dc1..1d8759a85 100644 --- a/test/serializers/fixtures/html/deserialize/inline/output.yaml +++ b/test/serializers/fixtures/html/deserialize/inline/output.yaml @@ -4,14 +4,16 @@ nodes: isVoid: false data: {} nodes: - - type: link - isVoid: false - data: {} - nodes: - - characters: - - text: o - marks: [] - - text: n - marks: [] - - text: e - marks: [] + - characters: [] + - type: link + isVoid: false + data: {} + nodes: + - characters: + - text: o + marks: [] + - text: n + marks: [] + - text: e + marks: [] + - characters: [] diff --git a/test/serializers/fixtures/raw/deserialize-terse/inline-nested/output.yaml b/test/serializers/fixtures/raw/deserialize-terse/inline-nested/output.yaml index 6cc09ef75..5c5af1b31 100644 --- a/test/serializers/fixtures/raw/deserialize-terse/inline-nested/output.yaml +++ b/test/serializers/fixtures/raw/deserialize-terse/inline-nested/output.yaml @@ -4,10 +4,12 @@ nodes: isVoid: false data: {} nodes: + - characters: [] - type: link isVoid: false data: {} nodes: + - characters: [] - type: hashtag isVoid: false data: {} @@ -19,3 +21,5 @@ nodes: marks: [] - text: e marks: [] + - characters: [] + - characters: [] diff --git a/test/serializers/fixtures/raw/deserialize-terse/inline-with-data/output.yaml b/test/serializers/fixtures/raw/deserialize-terse/inline-with-data/output.yaml index 518f9fa8c..2c01181c4 100644 --- a/test/serializers/fixtures/raw/deserialize-terse/inline-with-data/output.yaml +++ b/test/serializers/fixtures/raw/deserialize-terse/inline-with-data/output.yaml @@ -4,6 +4,7 @@ nodes: isVoid: false data: {} nodes: + - characters: [] - type: link isVoid: false data: @@ -16,3 +17,4 @@ nodes: marks: [] - text: e marks: [] + - characters: [] diff --git a/test/serializers/fixtures/raw/deserialize-terse/inline/output.yaml b/test/serializers/fixtures/raw/deserialize-terse/inline/output.yaml index 963558dc1..da8deae35 100644 --- a/test/serializers/fixtures/raw/deserialize-terse/inline/output.yaml +++ b/test/serializers/fixtures/raw/deserialize-terse/inline/output.yaml @@ -4,6 +4,7 @@ nodes: isVoid: false data: {} nodes: + - characters: [] - type: link isVoid: false data: {} @@ -15,3 +16,4 @@ nodes: marks: [] - text: e marks: [] + - characters: [] diff --git a/test/serializers/fixtures/raw/deserialize/inline-nested/output.yaml b/test/serializers/fixtures/raw/deserialize/inline-nested/output.yaml index 6cc09ef75..5c5af1b31 100644 --- a/test/serializers/fixtures/raw/deserialize/inline-nested/output.yaml +++ b/test/serializers/fixtures/raw/deserialize/inline-nested/output.yaml @@ -4,10 +4,12 @@ nodes: isVoid: false data: {} nodes: + - characters: [] - type: link isVoid: false data: {} nodes: + - characters: [] - type: hashtag isVoid: false data: {} @@ -19,3 +21,5 @@ nodes: marks: [] - text: e marks: [] + - characters: [] + - characters: [] diff --git a/test/serializers/fixtures/raw/deserialize/inline-with-data/output.yaml b/test/serializers/fixtures/raw/deserialize/inline-with-data/output.yaml index 518f9fa8c..2c01181c4 100644 --- a/test/serializers/fixtures/raw/deserialize/inline-with-data/output.yaml +++ b/test/serializers/fixtures/raw/deserialize/inline-with-data/output.yaml @@ -4,6 +4,7 @@ nodes: isVoid: false data: {} nodes: + - characters: [] - type: link isVoid: false data: @@ -16,3 +17,4 @@ nodes: marks: [] - text: e marks: [] + - characters: [] diff --git a/test/serializers/fixtures/raw/deserialize/inline/output.yaml b/test/serializers/fixtures/raw/deserialize/inline/output.yaml index 963558dc1..da8deae35 100644 --- a/test/serializers/fixtures/raw/deserialize/inline/output.yaml +++ b/test/serializers/fixtures/raw/deserialize/inline/output.yaml @@ -4,6 +4,7 @@ nodes: isVoid: false data: {} nodes: + - characters: [] - type: link isVoid: false data: {} @@ -15,3 +16,4 @@ nodes: marks: [] - text: e marks: [] + - characters: [] diff --git a/test/serializers/fixtures/raw/serialize-terse/inline-nested/output.yaml b/test/serializers/fixtures/raw/serialize-terse/inline-nested/output.yaml index 0f607dd81..db0877796 100644 --- a/test/serializers/fixtures/raw/serialize-terse/inline-nested/output.yaml +++ b/test/serializers/fixtures/raw/serialize-terse/inline-nested/output.yaml @@ -3,11 +3,19 @@ nodes: - kind: block type: paragraph nodes: + - kind: text + text: "" - kind: inline type: link nodes: + - kind: text + text: "" - kind: inline type: hashtag nodes: - kind: text text: one + - kind: text + text: "" + - kind: text + text: "" diff --git a/test/serializers/fixtures/raw/serialize-terse/inline-with-data/output.yaml b/test/serializers/fixtures/raw/serialize-terse/inline-with-data/output.yaml index 77c193787..4c59472a3 100644 --- a/test/serializers/fixtures/raw/serialize-terse/inline-with-data/output.yaml +++ b/test/serializers/fixtures/raw/serialize-terse/inline-with-data/output.yaml @@ -3,6 +3,8 @@ nodes: - kind: block type: paragraph nodes: + - kind: text + text: "" - kind: inline type: link data: @@ -10,3 +12,5 @@ nodes: nodes: - kind: text text: one + - kind: text + text: "" diff --git a/test/serializers/fixtures/raw/serialize-terse/inline/output.yaml b/test/serializers/fixtures/raw/serialize-terse/inline/output.yaml index 2ab734df3..4574dfa62 100644 --- a/test/serializers/fixtures/raw/serialize-terse/inline/output.yaml +++ b/test/serializers/fixtures/raw/serialize-terse/inline/output.yaml @@ -3,8 +3,12 @@ nodes: - kind: block type: paragraph nodes: + - kind: text + text: "" - kind: inline type: link nodes: - kind: text text: one + - kind: text + text: "" diff --git a/test/serializers/fixtures/raw/serialize/inline-nested/output.yaml b/test/serializers/fixtures/raw/serialize/inline-nested/output.yaml index 414ac45c2..29b94496e 100644 --- a/test/serializers/fixtures/raw/serialize/inline-nested/output.yaml +++ b/test/serializers/fixtures/raw/serialize/inline-nested/output.yaml @@ -8,11 +8,21 @@ document: data: {} isVoid: false nodes: + - kind: text + ranges: + - kind: range + text: "" + marks: [] - kind: inline type: link data: {} isVoid: false nodes: + - kind: text + ranges: + - kind: range + text: "" + marks: [] - kind: inline type: hashtag data: {} @@ -23,3 +33,13 @@ document: - kind: range text: one marks: [] + - kind: text + ranges: + - kind: range + text: "" + marks: [] + - kind: text + ranges: + - kind: range + text: "" + marks: [] diff --git a/test/serializers/fixtures/raw/serialize/inline-with-data/output.yaml b/test/serializers/fixtures/raw/serialize/inline-with-data/output.yaml index 33e101f58..7743d54da 100644 --- a/test/serializers/fixtures/raw/serialize/inline-with-data/output.yaml +++ b/test/serializers/fixtures/raw/serialize/inline-with-data/output.yaml @@ -8,6 +8,11 @@ document: data: {} isVoid: false nodes: + - kind: text + ranges: + - kind: range + text: "" + marks: [] - kind: inline type: link isVoid: false @@ -19,3 +24,8 @@ document: - kind: range text: one marks: [] + - kind: text + ranges: + - kind: range + text: "" + marks: [] diff --git a/test/serializers/fixtures/raw/serialize/inline/output.yaml b/test/serializers/fixtures/raw/serialize/inline/output.yaml index 6db60eaed..492727047 100644 --- a/test/serializers/fixtures/raw/serialize/inline/output.yaml +++ b/test/serializers/fixtures/raw/serialize/inline/output.yaml @@ -8,6 +8,11 @@ document: data: {} isVoid: false nodes: + - kind: text + ranges: + - kind: range + text: "" + marks: [] - kind: inline type: link data: {} @@ -18,3 +23,8 @@ document: - kind: range text: one marks: [] + - kind: text + ranges: + - kind: range + text: "" + marks: [] diff --git a/test/transforms/fixtures/at-current-range/delete/across-blocks-inlines/index.js b/test/transforms/fixtures/at-current-range/delete/across-blocks-inlines/index.js index fba0edf1d..995972e18 100644 --- a/test/transforms/fixtures/at-current-range/delete/across-blocks-inlines/index.js +++ b/test/transforms/fixtures/at-current-range/delete/across-blocks-inlines/index.js @@ -4,12 +4,12 @@ import assert from 'assert' export default function (state) { const { document, selection } = state const texts = document.getTexts() - const first = texts.first() - const last = texts.last() + const second = texts.get(1) + const fifth = texts.get(4) const range = selection.merge({ - anchorKey: first.key, + anchorKey: second.key, anchorOffset: 2, - focusKey: last.key, + focusKey: fifth.key, focusOffset: 2 }) diff --git a/test/transforms/fixtures/at-current-range/delete/across-blocks-inlines/input.yaml b/test/transforms/fixtures/at-current-range/delete/across-blocks-inlines/input.yaml index 2568c6b66..8cb1b0a19 100644 --- a/test/transforms/fixtures/at-current-range/delete/across-blocks-inlines/input.yaml +++ b/test/transforms/fixtures/at-current-range/delete/across-blocks-inlines/input.yaml @@ -3,16 +3,24 @@ nodes: - kind: block type: paragraph nodes: + - kind: text + text: "" - kind: inline type: link nodes: - kind: text text: word + - kind: text + text: "" - kind: block type: paragraph nodes: + - kind: text + text: "" - kind: inline type: link nodes: - kind: text text: another + - kind: text + text: "" diff --git a/test/transforms/fixtures/at-current-range/delete/across-blocks-inlines/output.yaml b/test/transforms/fixtures/at-current-range/delete/across-blocks-inlines/output.yaml index bb1a8c475..3322402db 100644 --- a/test/transforms/fixtures/at-current-range/delete/across-blocks-inlines/output.yaml +++ b/test/transforms/fixtures/at-current-range/delete/across-blocks-inlines/output.yaml @@ -3,13 +3,19 @@ nodes: - kind: block type: paragraph nodes: + - kind: text + text: "" - kind: inline type: link nodes: - kind: text text: wo + - kind: text + text: "" - kind: inline type: link nodes: - kind: text text: other + - kind: text + text: "" diff --git a/test/transforms/fixtures/at-current-range/split-block/with-delete-across-blocks-and-inlines/index.js b/test/transforms/fixtures/at-current-range/split-block/with-delete-across-blocks-and-inlines/index.js index dd5bab9f2..0c2138a5c 100644 --- a/test/transforms/fixtures/at-current-range/split-block/with-delete-across-blocks-and-inlines/index.js +++ b/test/transforms/fixtures/at-current-range/split-block/with-delete-across-blocks-and-inlines/index.js @@ -4,12 +4,12 @@ import assert from 'assert' export default function (state) { const { document, selection } = state const texts = document.getTexts() - const first = texts.first() - const second = texts.last() + const second = texts.get(1) + const fifth = texts.get(4) const range = selection.merge({ - anchorKey: first.key, + anchorKey: second.key, anchorOffset: 2, - focusKey: second.key, + focusKey: fifth.key, focusOffset: 2 }) @@ -19,7 +19,7 @@ export default function (state) { .splitBlock() .apply() - const updated = next.document.getTexts().get(1) + const updated = next.document.getTexts().get(4) assert.deepEqual( next.selection.toJS(), diff --git a/test/transforms/fixtures/at-current-range/split-block/with-delete-across-blocks-and-inlines/input.yaml b/test/transforms/fixtures/at-current-range/split-block/with-delete-across-blocks-and-inlines/input.yaml index 9d4daa75a..102c6529b 100644 --- a/test/transforms/fixtures/at-current-range/split-block/with-delete-across-blocks-and-inlines/input.yaml +++ b/test/transforms/fixtures/at-current-range/split-block/with-delete-across-blocks-and-inlines/input.yaml @@ -3,16 +3,24 @@ nodes: - kind: block type: paragraph nodes: + - kind: text + text: "" - kind: inline type: one nodes: - kind: text text: word + - kind: text + text: "" - kind: block type: paragraph nodes: + - kind: text + text: "" - kind: inline type: two nodes: - kind: text text: another + - kind: text + text: "" diff --git a/test/transforms/fixtures/at-current-range/split-block/with-delete-across-blocks-and-inlines/output.yaml b/test/transforms/fixtures/at-current-range/split-block/with-delete-across-blocks-and-inlines/output.yaml index b5fb12019..61d0e7a0a 100644 --- a/test/transforms/fixtures/at-current-range/split-block/with-delete-across-blocks-and-inlines/output.yaml +++ b/test/transforms/fixtures/at-current-range/split-block/with-delete-across-blocks-and-inlines/output.yaml @@ -3,16 +3,24 @@ nodes: - kind: block type: paragraph nodes: + - kind: text + text: "" - kind: inline type: one nodes: - kind: text text: wo + - kind: text + text: "" - kind: block type: paragraph nodes: + - kind: text + text: "" - kind: inline type: two nodes: - kind: text text: other + - kind: text + text: "" diff --git a/test/transforms/fixtures/at-range/add-mark-at-range/across-inlines/index.js b/test/transforms/fixtures/at-range/add-mark-at-range/across-inlines/index.js index e633e3f04..2b87ff248 100644 --- a/test/transforms/fixtures/at-range/add-mark-at-range/across-inlines/index.js +++ b/test/transforms/fixtures/at-range/add-mark-at-range/across-inlines/index.js @@ -2,12 +2,12 @@ export default function (state) { const { document, selection } = state const texts = document.getTexts() - const first = texts.first() - const second = texts.last() + const second = texts.get(1) + const fifth = texts.get(4) const range = selection.merge({ - anchorKey: first.key, + anchorKey: second.key, anchorOffset: 2, - focusKey: second.key, + focusKey: fifth.key, focusOffset: 2 }) diff --git a/test/transforms/fixtures/at-range/add-mark-at-range/across-inlines/input.yaml b/test/transforms/fixtures/at-range/add-mark-at-range/across-inlines/input.yaml index 2568c6b66..8cb1b0a19 100644 --- a/test/transforms/fixtures/at-range/add-mark-at-range/across-inlines/input.yaml +++ b/test/transforms/fixtures/at-range/add-mark-at-range/across-inlines/input.yaml @@ -3,16 +3,24 @@ nodes: - kind: block type: paragraph nodes: + - kind: text + text: "" - kind: inline type: link nodes: - kind: text text: word + - kind: text + text: "" - kind: block type: paragraph nodes: + - kind: text + text: "" - kind: inline type: link nodes: - kind: text text: another + - kind: text + text: "" diff --git a/test/transforms/fixtures/at-range/add-mark-at-range/across-inlines/output.yaml b/test/transforms/fixtures/at-range/add-mark-at-range/across-inlines/output.yaml index 7bf3a7a16..cd34e2769 100644 --- a/test/transforms/fixtures/at-range/add-mark-at-range/across-inlines/output.yaml +++ b/test/transforms/fixtures/at-range/add-mark-at-range/across-inlines/output.yaml @@ -3,6 +3,8 @@ nodes: - kind: block type: paragraph nodes: + - kind: text + text: "" - kind: inline type: link nodes: @@ -12,9 +14,13 @@ nodes: - text: rd marks: - type: bold + - kind: text + text: "" - kind: block type: paragraph nodes: + - kind: text + text: "" - kind: inline type: link nodes: @@ -24,3 +30,5 @@ nodes: marks: - type: bold - text: other + - kind: text + text: "" diff --git a/test/transforms/fixtures/at-range/delete-at-range/across-blocks-inlines/index.js b/test/transforms/fixtures/at-range/delete-at-range/across-blocks-inlines/index.js index 5d5f179bc..5d9a15121 100644 --- a/test/transforms/fixtures/at-range/delete-at-range/across-blocks-inlines/index.js +++ b/test/transforms/fixtures/at-range/delete-at-range/across-blocks-inlines/index.js @@ -2,12 +2,12 @@ export default function (state) { const { document, selection } = state const texts = document.getTexts() - const first = texts.first() - const last = texts.last() + const second = texts.get(1) + const fifth = texts.get(4) const range = selection.merge({ - anchorKey: first.key, + anchorKey: second.key, anchorOffset: 2, - focusKey: last.key, + focusKey: fifth.key, focusOffset: 2 }) diff --git a/test/transforms/fixtures/at-range/delete-at-range/across-blocks-inlines/input.yaml b/test/transforms/fixtures/at-range/delete-at-range/across-blocks-inlines/input.yaml index 2568c6b66..8cb1b0a19 100644 --- a/test/transforms/fixtures/at-range/delete-at-range/across-blocks-inlines/input.yaml +++ b/test/transforms/fixtures/at-range/delete-at-range/across-blocks-inlines/input.yaml @@ -3,16 +3,24 @@ nodes: - kind: block type: paragraph nodes: + - kind: text + text: "" - kind: inline type: link nodes: - kind: text text: word + - kind: text + text: "" - kind: block type: paragraph nodes: + - kind: text + text: "" - kind: inline type: link nodes: - kind: text text: another + - kind: text + text: "" diff --git a/test/transforms/fixtures/at-range/delete-at-range/across-blocks-inlines/output.yaml b/test/transforms/fixtures/at-range/delete-at-range/across-blocks-inlines/output.yaml index bb1a8c475..3322402db 100644 --- a/test/transforms/fixtures/at-range/delete-at-range/across-blocks-inlines/output.yaml +++ b/test/transforms/fixtures/at-range/delete-at-range/across-blocks-inlines/output.yaml @@ -3,13 +3,19 @@ nodes: - kind: block type: paragraph nodes: + - kind: text + text: "" - kind: inline type: link nodes: - kind: text text: wo + - kind: text + text: "" - kind: inline type: link nodes: - kind: text text: other + - kind: text + text: "" diff --git a/test/transforms/fixtures/at-range/delete-at-range/before-inline-sibling/output.yaml b/test/transforms/fixtures/at-range/delete-at-range/before-inline-sibling/output.yaml index 798f00a1b..2b96bda07 100644 --- a/test/transforms/fixtures/at-range/delete-at-range/before-inline-sibling/output.yaml +++ b/test/transforms/fixtures/at-range/delete-at-range/before-inline-sibling/output.yaml @@ -10,3 +10,5 @@ nodes: nodes: - kind: text text: two + - kind: text + text: "" diff --git a/test/transforms/fixtures/at-range/delete-at-range/whole-inline/index.js b/test/transforms/fixtures/at-range/delete-at-range/whole-inline/index.js index f86c52492..bdeb64bdb 100644 --- a/test/transforms/fixtures/at-range/delete-at-range/whole-inline/index.js +++ b/test/transforms/fixtures/at-range/delete-at-range/whole-inline/index.js @@ -2,12 +2,12 @@ export default function (state) { const { document, selection } = state const texts = document.getTexts() - const first = texts.first() + const second = texts.get(1) const range = selection.merge({ - anchorKey: first.key, + anchorKey: second.key, anchorOffset: 0, - focusKey: first.key, - focusOffset: first.length + focusKey: second.key, + focusOffset: second.length }) return state diff --git a/test/transforms/fixtures/at-range/delete-at-range/whole-inline/input.yaml b/test/transforms/fixtures/at-range/delete-at-range/whole-inline/input.yaml index f752cee89..8d1a24e00 100644 --- a/test/transforms/fixtures/at-range/delete-at-range/whole-inline/input.yaml +++ b/test/transforms/fixtures/at-range/delete-at-range/whole-inline/input.yaml @@ -3,8 +3,12 @@ nodes: - kind: block type: paragraph nodes: + - kind: text + text: "" - kind: inline type: link nodes: - kind: text text: word + - kind: text + text: "" diff --git a/test/transforms/fixtures/at-range/delete-backward-at-range/before-inline-sibling/output.yaml b/test/transforms/fixtures/at-range/delete-backward-at-range/before-inline-sibling/output.yaml index 798f00a1b..2b96bda07 100644 --- a/test/transforms/fixtures/at-range/delete-backward-at-range/before-inline-sibling/output.yaml +++ b/test/transforms/fixtures/at-range/delete-backward-at-range/before-inline-sibling/output.yaml @@ -10,3 +10,5 @@ nodes: nodes: - kind: text text: two + - kind: text + text: "" diff --git a/test/transforms/fixtures/at-range/delete-forward-at-range/before-inline-sibling/output.yaml b/test/transforms/fixtures/at-range/delete-forward-at-range/before-inline-sibling/output.yaml index 798f00a1b..2b96bda07 100644 --- a/test/transforms/fixtures/at-range/delete-forward-at-range/before-inline-sibling/output.yaml +++ b/test/transforms/fixtures/at-range/delete-forward-at-range/before-inline-sibling/output.yaml @@ -10,3 +10,5 @@ nodes: nodes: - kind: text text: two + - kind: text + text: "" diff --git a/test/transforms/fixtures/at-range/insert-fragment-at-range/end-inline/index.js b/test/transforms/fixtures/at-range/insert-fragment-at-range/end-inline/index.js index 67ab9681c..7cbb844da 100644 --- a/test/transforms/fixtures/at-range/insert-fragment-at-range/end-inline/index.js +++ b/test/transforms/fixtures/at-range/insert-fragment-at-range/end-inline/index.js @@ -10,12 +10,12 @@ export default function (state) { const { document, selection } = state const texts = document.getTexts() - const first = texts.first() + const second = texts.get(1) const range = selection.merge({ - anchorKey: first.key, - anchorOffset: first.length, - focusKey: first.key, - focusOffset: first.length + anchorKey: second.key, + anchorOffset: second.length, + focusKey: second.key, + focusOffset: second.length }) return state diff --git a/test/transforms/fixtures/at-range/insert-fragment-at-range/end-inline/input.yaml b/test/transforms/fixtures/at-range/insert-fragment-at-range/end-inline/input.yaml index f752cee89..8d1a24e00 100644 --- a/test/transforms/fixtures/at-range/insert-fragment-at-range/end-inline/input.yaml +++ b/test/transforms/fixtures/at-range/insert-fragment-at-range/end-inline/input.yaml @@ -3,8 +3,12 @@ nodes: - kind: block type: paragraph nodes: + - kind: text + text: "" - kind: inline type: link nodes: - kind: text text: word + - kind: text + text: "" diff --git a/test/transforms/fixtures/at-range/insert-fragment-at-range/end-inline/output.yaml b/test/transforms/fixtures/at-range/insert-fragment-at-range/end-inline/output.yaml index e67f3259f..c8b5286b6 100644 --- a/test/transforms/fixtures/at-range/insert-fragment-at-range/end-inline/output.yaml +++ b/test/transforms/fixtures/at-range/insert-fragment-at-range/end-inline/output.yaml @@ -3,6 +3,8 @@ nodes: - kind: block type: paragraph nodes: + - kind: text + text: "" - kind: inline type: link nodes: diff --git a/test/transforms/fixtures/at-range/insert-fragment-at-range/middle-inline-fragment-inline/index.js b/test/transforms/fixtures/at-range/insert-fragment-at-range/middle-inline-fragment-inline/index.js index 8223d04db..562832c80 100644 --- a/test/transforms/fixtures/at-range/insert-fragment-at-range/middle-inline-fragment-inline/index.js +++ b/test/transforms/fixtures/at-range/insert-fragment-at-range/middle-inline-fragment-inline/index.js @@ -10,11 +10,11 @@ export default function (state) { const { document, selection } = state const texts = document.getTexts() - const first = texts.first() + const second = texts.get(1) const range = selection.merge({ - anchorKey: first.key, + anchorKey: second.key, anchorOffset: 2, - focusKey: first.key, + focusKey: second.key, focusOffset: 2 }) diff --git a/test/transforms/fixtures/at-range/insert-fragment-at-range/middle-inline-fragment-inline/input.yaml b/test/transforms/fixtures/at-range/insert-fragment-at-range/middle-inline-fragment-inline/input.yaml index f752cee89..8d1a24e00 100644 --- a/test/transforms/fixtures/at-range/insert-fragment-at-range/middle-inline-fragment-inline/input.yaml +++ b/test/transforms/fixtures/at-range/insert-fragment-at-range/middle-inline-fragment-inline/input.yaml @@ -3,8 +3,12 @@ nodes: - kind: block type: paragraph nodes: + - kind: text + text: "" - kind: inline type: link nodes: - kind: text text: word + - kind: text + text: "" diff --git a/test/transforms/fixtures/at-range/insert-fragment-at-range/middle-inline-fragment-inline/output.yaml b/test/transforms/fixtures/at-range/insert-fragment-at-range/middle-inline-fragment-inline/output.yaml index c46ff4c5c..91808988d 100644 --- a/test/transforms/fixtures/at-range/insert-fragment-at-range/middle-inline-fragment-inline/output.yaml +++ b/test/transforms/fixtures/at-range/insert-fragment-at-range/middle-inline-fragment-inline/output.yaml @@ -3,18 +3,26 @@ nodes: - kind: block type: paragraph nodes: + - kind: text + text: "" - kind: inline type: link nodes: - kind: text text: wo + - kind: text + text: "" - kind: inline type: hashtag nodes: - kind: text text: fragment + - kind: text + text: "" - kind: inline type: link nodes: - kind: text text: rd + - kind: text + text: "" diff --git a/test/transforms/fixtures/at-range/insert-fragment-at-range/middle-inline/index.js b/test/transforms/fixtures/at-range/insert-fragment-at-range/middle-inline/index.js index 8223d04db..562832c80 100644 --- a/test/transforms/fixtures/at-range/insert-fragment-at-range/middle-inline/index.js +++ b/test/transforms/fixtures/at-range/insert-fragment-at-range/middle-inline/index.js @@ -10,11 +10,11 @@ export default function (state) { const { document, selection } = state const texts = document.getTexts() - const first = texts.first() + const second = texts.get(1) const range = selection.merge({ - anchorKey: first.key, + anchorKey: second.key, anchorOffset: 2, - focusKey: first.key, + focusKey: second.key, focusOffset: 2 }) diff --git a/test/transforms/fixtures/at-range/insert-fragment-at-range/middle-inline/input.yaml b/test/transforms/fixtures/at-range/insert-fragment-at-range/middle-inline/input.yaml index f752cee89..8d1a24e00 100644 --- a/test/transforms/fixtures/at-range/insert-fragment-at-range/middle-inline/input.yaml +++ b/test/transforms/fixtures/at-range/insert-fragment-at-range/middle-inline/input.yaml @@ -3,8 +3,12 @@ nodes: - kind: block type: paragraph nodes: + - kind: text + text: "" - kind: inline type: link nodes: - kind: text text: word + - kind: text + text: "" diff --git a/test/transforms/fixtures/at-range/insert-fragment-at-range/middle-inline/output.yaml b/test/transforms/fixtures/at-range/insert-fragment-at-range/middle-inline/output.yaml index 89a19d352..5429bd352 100644 --- a/test/transforms/fixtures/at-range/insert-fragment-at-range/middle-inline/output.yaml +++ b/test/transforms/fixtures/at-range/insert-fragment-at-range/middle-inline/output.yaml @@ -3,6 +3,8 @@ nodes: - kind: block type: paragraph nodes: + - kind: text + text: "" - kind: inline type: link nodes: @@ -15,3 +17,5 @@ nodes: nodes: - kind: text text: rd + - kind: text + text: "" diff --git a/test/transforms/fixtures/at-range/insert-fragment-at-range/start-inline/index.js b/test/transforms/fixtures/at-range/insert-fragment-at-range/start-inline/index.js index 8d9062ac5..422affe73 100644 --- a/test/transforms/fixtures/at-range/insert-fragment-at-range/start-inline/index.js +++ b/test/transforms/fixtures/at-range/insert-fragment-at-range/start-inline/index.js @@ -10,11 +10,11 @@ export default function (state) { const { document, selection } = state const texts = document.getTexts() - const first = texts.first() + const second = texts.get(1) const range = selection.merge({ - anchorKey: first.key, + anchorKey: second.key, anchorOffset: 0, - focusKey: first.key, + focusKey: second.key, focusOffset: 0 }) diff --git a/test/transforms/fixtures/at-range/insert-fragment-at-range/start-inline/input.yaml b/test/transforms/fixtures/at-range/insert-fragment-at-range/start-inline/input.yaml index f752cee89..8d1a24e00 100644 --- a/test/transforms/fixtures/at-range/insert-fragment-at-range/start-inline/input.yaml +++ b/test/transforms/fixtures/at-range/insert-fragment-at-range/start-inline/input.yaml @@ -3,8 +3,12 @@ nodes: - kind: block type: paragraph nodes: + - kind: text + text: "" - kind: inline type: link nodes: - kind: text text: word + - kind: text + text: "" diff --git a/test/transforms/fixtures/at-range/insert-fragment-at-range/start-inline/output.yaml b/test/transforms/fixtures/at-range/insert-fragment-at-range/start-inline/output.yaml index aab1b1ea4..fc31e506e 100644 --- a/test/transforms/fixtures/at-range/insert-fragment-at-range/start-inline/output.yaml +++ b/test/transforms/fixtures/at-range/insert-fragment-at-range/start-inline/output.yaml @@ -10,3 +10,5 @@ nodes: nodes: - kind: text text: word + - kind: text + text: "" diff --git a/test/transforms/fixtures/at-range/insert-inline-at-range/inside-inline/index.js b/test/transforms/fixtures/at-range/insert-inline-at-range/inside-inline/index.js index 3cee371eb..6d23262af 100644 --- a/test/transforms/fixtures/at-range/insert-inline-at-range/inside-inline/index.js +++ b/test/transforms/fixtures/at-range/insert-inline-at-range/inside-inline/index.js @@ -2,11 +2,11 @@ export default function (state) { const { document, selection } = state const texts = document.getTexts() - const first = texts.first() + const second = texts.get(1) const range = selection.merge({ - anchorKey: first.key, + anchorKey: second.key, anchorOffset: 2, - focusKey: first.key, + focusKey: second.key, focusOffset: 2 }) diff --git a/test/transforms/fixtures/at-range/insert-inline-at-range/inside-inline/input.yaml b/test/transforms/fixtures/at-range/insert-inline-at-range/inside-inline/input.yaml index f752cee89..8d1a24e00 100644 --- a/test/transforms/fixtures/at-range/insert-inline-at-range/inside-inline/input.yaml +++ b/test/transforms/fixtures/at-range/insert-inline-at-range/inside-inline/input.yaml @@ -3,8 +3,12 @@ nodes: - kind: block type: paragraph nodes: + - kind: text + text: "" - kind: inline type: link nodes: - kind: text text: word + - kind: text + text: "" diff --git a/test/transforms/fixtures/at-range/insert-inline-at-range/inside-inline/output.yaml b/test/transforms/fixtures/at-range/insert-inline-at-range/inside-inline/output.yaml index 43b2b1a37..13227499f 100644 --- a/test/transforms/fixtures/at-range/insert-inline-at-range/inside-inline/output.yaml +++ b/test/transforms/fixtures/at-range/insert-inline-at-range/inside-inline/output.yaml @@ -3,6 +3,8 @@ nodes: - kind: block type: paragraph nodes: + - kind: text + text: "" - kind: inline type: link nodes: @@ -13,3 +15,5 @@ nodes: isVoid: true - kind: text text: rd + - kind: text + text: "" diff --git a/test/transforms/fixtures/at-range/remove-mark-at-range/across-inlines/index.js b/test/transforms/fixtures/at-range/remove-mark-at-range/across-inlines/index.js index 073a8bdd7..a800bb56b 100644 --- a/test/transforms/fixtures/at-range/remove-mark-at-range/across-inlines/index.js +++ b/test/transforms/fixtures/at-range/remove-mark-at-range/across-inlines/index.js @@ -2,12 +2,12 @@ export default function (state) { const { document, selection } = state const texts = document.getTexts() - const first = texts.first() - const second = texts.last() + const second = texts.get(1) + const fifth = texts.get(4) const range = selection.merge({ - anchorKey: first.key, + anchorKey: second.key, anchorOffset: 2, - focusKey: second.key, + focusKey: fifth.key, focusOffset: 2 }) diff --git a/test/transforms/fixtures/at-range/remove-mark-at-range/across-inlines/input.yaml b/test/transforms/fixtures/at-range/remove-mark-at-range/across-inlines/input.yaml index 68d1f01fc..ae18e4221 100644 --- a/test/transforms/fixtures/at-range/remove-mark-at-range/across-inlines/input.yaml +++ b/test/transforms/fixtures/at-range/remove-mark-at-range/across-inlines/input.yaml @@ -3,6 +3,8 @@ nodes: - kind: block type: paragraph nodes: + - kind: text + text: "" - kind: inline type: link nodes: @@ -11,9 +13,13 @@ nodes: - text: word marks: - type: bold + - kind: text + text: "" - kind: block type: paragraph nodes: + - kind: text + text: "" - kind: inline type: link nodes: @@ -22,3 +28,5 @@ nodes: - text: another marks: - type: bold + - kind: text + text: "" diff --git a/test/transforms/fixtures/at-range/remove-mark-at-range/across-inlines/output.yaml b/test/transforms/fixtures/at-range/remove-mark-at-range/across-inlines/output.yaml index 68568ba65..ebf301182 100644 --- a/test/transforms/fixtures/at-range/remove-mark-at-range/across-inlines/output.yaml +++ b/test/transforms/fixtures/at-range/remove-mark-at-range/across-inlines/output.yaml @@ -3,6 +3,8 @@ nodes: - kind: block type: paragraph nodes: + - kind: text + text: "" - kind: inline type: link nodes: @@ -12,9 +14,13 @@ nodes: marks: - type: bold - text: rd + - kind: text + text: "" - kind: block type: paragraph nodes: + - kind: text + text: "" - kind: inline type: link nodes: @@ -24,3 +30,5 @@ nodes: - text: other marks: - type: bold + - kind: text + text: "" diff --git a/test/transforms/fixtures/at-range/set-block-at-range/across-inlines/index.js b/test/transforms/fixtures/at-range/set-block-at-range/across-inlines/index.js index 50f7e18fd..5ff3176c1 100644 --- a/test/transforms/fixtures/at-range/set-block-at-range/across-inlines/index.js +++ b/test/transforms/fixtures/at-range/set-block-at-range/across-inlines/index.js @@ -2,12 +2,12 @@ export default function (state) { const { document, selection } = state const texts = document.getTexts() - const first = texts.first() - const second = texts.last() + const second = texts.get(1) + const fifth = texts.get(4) const range = selection.merge({ - anchorKey: first.key, + anchorKey: second.key, anchorOffset: 2, - focusKey: second.key, + focusKey: fifth.key, focusOffset: 2 }) diff --git a/test/transforms/fixtures/at-range/set-block-at-range/across-inlines/input.yaml b/test/transforms/fixtures/at-range/set-block-at-range/across-inlines/input.yaml index 2568c6b66..8cb1b0a19 100644 --- a/test/transforms/fixtures/at-range/set-block-at-range/across-inlines/input.yaml +++ b/test/transforms/fixtures/at-range/set-block-at-range/across-inlines/input.yaml @@ -3,16 +3,24 @@ nodes: - kind: block type: paragraph nodes: + - kind: text + text: "" - kind: inline type: link nodes: - kind: text text: word + - kind: text + text: "" - kind: block type: paragraph nodes: + - kind: text + text: "" - kind: inline type: link nodes: - kind: text text: another + - kind: text + text: "" diff --git a/test/transforms/fixtures/at-range/set-block-at-range/across-inlines/output.yaml b/test/transforms/fixtures/at-range/set-block-at-range/across-inlines/output.yaml index 886e1ad23..201ca148d 100644 --- a/test/transforms/fixtures/at-range/set-block-at-range/across-inlines/output.yaml +++ b/test/transforms/fixtures/at-range/set-block-at-range/across-inlines/output.yaml @@ -3,16 +3,24 @@ nodes: - kind: block type: code nodes: + - kind: text + text: "" - kind: inline type: link nodes: - kind: text text: word + - kind: text + text: "" - kind: block type: code nodes: + - kind: text + text: "" - kind: inline type: link nodes: - kind: text text: another + - kind: text + text: "" diff --git a/test/transforms/fixtures/at-range/set-inline-at-range/across-inlines/index.js b/test/transforms/fixtures/at-range/set-inline-at-range/across-inlines/index.js index abd1dbf0c..466b98bbb 100644 --- a/test/transforms/fixtures/at-range/set-inline-at-range/across-inlines/index.js +++ b/test/transforms/fixtures/at-range/set-inline-at-range/across-inlines/index.js @@ -2,12 +2,12 @@ export default function (state) { const { document, selection } = state const texts = document.getTexts() - const first = texts.first() - const second = texts.last() + const second = texts.get(1) + const fifth = texts.get(4) const range = selection.merge({ - anchorKey: first.key, + anchorKey: second.key, anchorOffset: 2, - focusKey: second.key, + focusKey: fifth.key, focusOffset: 2 }) diff --git a/test/transforms/fixtures/at-range/set-inline-at-range/across-inlines/input.yaml b/test/transforms/fixtures/at-range/set-inline-at-range/across-inlines/input.yaml index 2568c6b66..8cb1b0a19 100644 --- a/test/transforms/fixtures/at-range/set-inline-at-range/across-inlines/input.yaml +++ b/test/transforms/fixtures/at-range/set-inline-at-range/across-inlines/input.yaml @@ -3,16 +3,24 @@ nodes: - kind: block type: paragraph nodes: + - kind: text + text: "" - kind: inline type: link nodes: - kind: text text: word + - kind: text + text: "" - kind: block type: paragraph nodes: + - kind: text + text: "" - kind: inline type: link nodes: - kind: text text: another + - kind: text + text: "" diff --git a/test/transforms/fixtures/at-range/set-inline-at-range/across-inlines/output.yaml b/test/transforms/fixtures/at-range/set-inline-at-range/across-inlines/output.yaml index 213d5d4d0..43f1b0fa1 100644 --- a/test/transforms/fixtures/at-range/set-inline-at-range/across-inlines/output.yaml +++ b/test/transforms/fixtures/at-range/set-inline-at-range/across-inlines/output.yaml @@ -3,16 +3,24 @@ nodes: - kind: block type: paragraph nodes: + - kind: text + text: "" - kind: inline type: code nodes: - kind: text text: word + - kind: text + text: "" - kind: block type: paragraph nodes: + - kind: text + text: "" - kind: inline type: code nodes: - kind: text text: another + - kind: text + text: "" diff --git a/test/transforms/fixtures/at-range/set-inline-at-range/data-only/index.js b/test/transforms/fixtures/at-range/set-inline-at-range/data-only/index.js index ad4cd68f9..af2fa77e5 100644 --- a/test/transforms/fixtures/at-range/set-inline-at-range/data-only/index.js +++ b/test/transforms/fixtures/at-range/set-inline-at-range/data-only/index.js @@ -4,11 +4,11 @@ import { Data } from '../../../../../..' export default function (state) { const { document, selection } = state const texts = document.getTexts() - const first = texts.first() + const second = texts.get(1) const range = selection.merge({ - anchorKey: first.key, + anchorKey: second.key, anchorOffset: 0, - focusKey: first.key, + focusKey: second.key, focusOffset: 0 }) diff --git a/test/transforms/fixtures/at-range/set-inline-at-range/data-only/input.yaml b/test/transforms/fixtures/at-range/set-inline-at-range/data-only/input.yaml index f752cee89..8d1a24e00 100644 --- a/test/transforms/fixtures/at-range/set-inline-at-range/data-only/input.yaml +++ b/test/transforms/fixtures/at-range/set-inline-at-range/data-only/input.yaml @@ -3,8 +3,12 @@ nodes: - kind: block type: paragraph nodes: + - kind: text + text: "" - kind: inline type: link nodes: - kind: text text: word + - kind: text + text: "" diff --git a/test/transforms/fixtures/at-range/set-inline-at-range/data-only/output.yaml b/test/transforms/fixtures/at-range/set-inline-at-range/data-only/output.yaml index 9dca59f2e..b9f6c5540 100644 --- a/test/transforms/fixtures/at-range/set-inline-at-range/data-only/output.yaml +++ b/test/transforms/fixtures/at-range/set-inline-at-range/data-only/output.yaml @@ -3,6 +3,8 @@ nodes: - kind: block type: paragraph nodes: + - kind: text + text: "" - kind: inline type: link data: @@ -10,3 +12,5 @@ nodes: nodes: - kind: text text: word + - kind: text + text: "" diff --git a/test/transforms/fixtures/at-range/set-inline-at-range/nested-inline/index.js b/test/transforms/fixtures/at-range/set-inline-at-range/nested-inline/index.js index 25752b21f..f3fd7f957 100644 --- a/test/transforms/fixtures/at-range/set-inline-at-range/nested-inline/index.js +++ b/test/transforms/fixtures/at-range/set-inline-at-range/nested-inline/index.js @@ -2,11 +2,11 @@ export default function (state) { const { document, selection } = state const texts = document.getTexts() - const first = texts.first() + const third = texts.get(2) const range = selection.merge({ - anchorKey: first.key, + anchorKey: third.key, anchorOffset: 0, - focusKey: first.key, + focusKey: third.key, focusOffset: 0 }) diff --git a/test/transforms/fixtures/at-range/set-inline-at-range/nested-inline/input.yaml b/test/transforms/fixtures/at-range/set-inline-at-range/nested-inline/input.yaml index 6d5ef6ffe..ba0c024fe 100644 --- a/test/transforms/fixtures/at-range/set-inline-at-range/nested-inline/input.yaml +++ b/test/transforms/fixtures/at-range/set-inline-at-range/nested-inline/input.yaml @@ -3,11 +3,19 @@ nodes: - kind: block type: paragraph nodes: + - kind: text + text: "" - kind: inline type: hashtag nodes: + - kind: text + text: "" - kind: inline type: link nodes: - kind: text text: word + - kind: text + text: "" + - kind: text + text: "" diff --git a/test/transforms/fixtures/at-range/set-inline-at-range/nested-inline/output.yaml b/test/transforms/fixtures/at-range/set-inline-at-range/nested-inline/output.yaml index 92e1191ee..271809fa2 100644 --- a/test/transforms/fixtures/at-range/set-inline-at-range/nested-inline/output.yaml +++ b/test/transforms/fixtures/at-range/set-inline-at-range/nested-inline/output.yaml @@ -3,11 +3,19 @@ nodes: - kind: block type: paragraph nodes: + - kind: text + text: "" - kind: inline type: hashtag nodes: + - kind: text + text: "" - kind: inline type: code nodes: - kind: text text: word + - kind: text + text: "" + - kind: text + text: "" diff --git a/test/transforms/fixtures/at-range/set-inline-at-range/single-inline-string-shorthand/index.js b/test/transforms/fixtures/at-range/set-inline-at-range/single-inline-string-shorthand/index.js index e858a54db..b6431061f 100644 --- a/test/transforms/fixtures/at-range/set-inline-at-range/single-inline-string-shorthand/index.js +++ b/test/transforms/fixtures/at-range/set-inline-at-range/single-inline-string-shorthand/index.js @@ -2,11 +2,11 @@ export default function (state) { const { document, selection } = state const texts = document.getTexts() - const first = texts.first() + const second = texts.get(1) const range = selection.merge({ - anchorKey: first.key, + anchorKey: second.key, anchorOffset: 0, - focusKey: first.key, + focusKey: second.key, focusOffset: 0 }) diff --git a/test/transforms/fixtures/at-range/set-inline-at-range/single-inline-string-shorthand/input.yaml b/test/transforms/fixtures/at-range/set-inline-at-range/single-inline-string-shorthand/input.yaml index f752cee89..8d1a24e00 100644 --- a/test/transforms/fixtures/at-range/set-inline-at-range/single-inline-string-shorthand/input.yaml +++ b/test/transforms/fixtures/at-range/set-inline-at-range/single-inline-string-shorthand/input.yaml @@ -3,8 +3,12 @@ nodes: - kind: block type: paragraph nodes: + - kind: text + text: "" - kind: inline type: link nodes: - kind: text text: word + - kind: text + text: "" diff --git a/test/transforms/fixtures/at-range/set-inline-at-range/single-inline-string-shorthand/output.yaml b/test/transforms/fixtures/at-range/set-inline-at-range/single-inline-string-shorthand/output.yaml index ce1ccbc2b..911a48adc 100644 --- a/test/transforms/fixtures/at-range/set-inline-at-range/single-inline-string-shorthand/output.yaml +++ b/test/transforms/fixtures/at-range/set-inline-at-range/single-inline-string-shorthand/output.yaml @@ -3,8 +3,12 @@ nodes: - kind: block type: paragraph nodes: + - kind: text + text: "" - kind: inline type: code nodes: - kind: text text: word + - kind: text + text: "" diff --git a/test/transforms/fixtures/at-range/set-inline-at-range/single-inline/index.js b/test/transforms/fixtures/at-range/set-inline-at-range/single-inline/index.js index 25752b21f..4c6f8b921 100644 --- a/test/transforms/fixtures/at-range/set-inline-at-range/single-inline/index.js +++ b/test/transforms/fixtures/at-range/set-inline-at-range/single-inline/index.js @@ -2,11 +2,11 @@ export default function (state) { const { document, selection } = state const texts = document.getTexts() - const first = texts.first() + const second = texts.get(1) const range = selection.merge({ - anchorKey: first.key, + anchorKey: second.key, anchorOffset: 0, - focusKey: first.key, + focusKey: second.key, focusOffset: 0 }) diff --git a/test/transforms/fixtures/at-range/set-inline-at-range/single-inline/input.yaml b/test/transforms/fixtures/at-range/set-inline-at-range/single-inline/input.yaml index f752cee89..8d1a24e00 100644 --- a/test/transforms/fixtures/at-range/set-inline-at-range/single-inline/input.yaml +++ b/test/transforms/fixtures/at-range/set-inline-at-range/single-inline/input.yaml @@ -3,8 +3,12 @@ nodes: - kind: block type: paragraph nodes: + - kind: text + text: "" - kind: inline type: link nodes: - kind: text text: word + - kind: text + text: "" diff --git a/test/transforms/fixtures/at-range/set-inline-at-range/single-inline/output.yaml b/test/transforms/fixtures/at-range/set-inline-at-range/single-inline/output.yaml index ce1ccbc2b..911a48adc 100644 --- a/test/transforms/fixtures/at-range/set-inline-at-range/single-inline/output.yaml +++ b/test/transforms/fixtures/at-range/set-inline-at-range/single-inline/output.yaml @@ -3,8 +3,12 @@ nodes: - kind: block type: paragraph nodes: + - kind: text + text: "" - kind: inline type: code nodes: - kind: text text: word + - kind: text + text: "" diff --git a/test/transforms/fixtures/at-range/set-inline-at-range/with-data-object/index.js b/test/transforms/fixtures/at-range/set-inline-at-range/with-data-object/index.js index e63f8636e..fa038f7a4 100644 --- a/test/transforms/fixtures/at-range/set-inline-at-range/with-data-object/index.js +++ b/test/transforms/fixtures/at-range/set-inline-at-range/with-data-object/index.js @@ -2,11 +2,11 @@ export default function (state) { const { document, selection } = state const texts = document.getTexts() - const first = texts.first() + const second = texts.get(1) const range = selection.merge({ - anchorKey: first.key, + anchorKey: second.key, anchorOffset: 0, - focusKey: first.key, + focusKey: second.key, focusOffset: 0 }) diff --git a/test/transforms/fixtures/at-range/set-inline-at-range/with-data-object/input.yaml b/test/transforms/fixtures/at-range/set-inline-at-range/with-data-object/input.yaml index f752cee89..8d1a24e00 100644 --- a/test/transforms/fixtures/at-range/set-inline-at-range/with-data-object/input.yaml +++ b/test/transforms/fixtures/at-range/set-inline-at-range/with-data-object/input.yaml @@ -3,8 +3,12 @@ nodes: - kind: block type: paragraph nodes: + - kind: text + text: "" - kind: inline type: link nodes: - kind: text text: word + - kind: text + text: "" diff --git a/test/transforms/fixtures/at-range/set-inline-at-range/with-data-object/output.yaml b/test/transforms/fixtures/at-range/set-inline-at-range/with-data-object/output.yaml index f8e56c7ce..8044fadab 100644 --- a/test/transforms/fixtures/at-range/set-inline-at-range/with-data-object/output.yaml +++ b/test/transforms/fixtures/at-range/set-inline-at-range/with-data-object/output.yaml @@ -3,6 +3,8 @@ nodes: - kind: block type: paragraph nodes: + - kind: text + text: "" - kind: inline type: code data: @@ -10,3 +12,5 @@ nodes: nodes: - kind: text text: word + - kind: text + text: "" diff --git a/test/transforms/fixtures/at-range/set-inline-at-range/with-data/index.js b/test/transforms/fixtures/at-range/set-inline-at-range/with-data/index.js index b0133747e..6bc4b10bf 100644 --- a/test/transforms/fixtures/at-range/set-inline-at-range/with-data/index.js +++ b/test/transforms/fixtures/at-range/set-inline-at-range/with-data/index.js @@ -4,11 +4,11 @@ import { Data } from '../../../../../..' export default function (state) { const { document, selection } = state const texts = document.getTexts() - const first = texts.first() + const second = texts.get(1) const range = selection.merge({ - anchorKey: first.key, + anchorKey: second.key, anchorOffset: 0, - focusKey: first.key, + focusKey: second.key, focusOffset: 0 }) diff --git a/test/transforms/fixtures/at-range/set-inline-at-range/with-data/input.yaml b/test/transforms/fixtures/at-range/set-inline-at-range/with-data/input.yaml index f752cee89..8d1a24e00 100644 --- a/test/transforms/fixtures/at-range/set-inline-at-range/with-data/input.yaml +++ b/test/transforms/fixtures/at-range/set-inline-at-range/with-data/input.yaml @@ -3,8 +3,12 @@ nodes: - kind: block type: paragraph nodes: + - kind: text + text: "" - kind: inline type: link nodes: - kind: text text: word + - kind: text + text: "" diff --git a/test/transforms/fixtures/at-range/set-inline-at-range/with-data/output.yaml b/test/transforms/fixtures/at-range/set-inline-at-range/with-data/output.yaml index f8e56c7ce..8044fadab 100644 --- a/test/transforms/fixtures/at-range/set-inline-at-range/with-data/output.yaml +++ b/test/transforms/fixtures/at-range/set-inline-at-range/with-data/output.yaml @@ -3,6 +3,8 @@ nodes: - kind: block type: paragraph nodes: + - kind: text + text: "" - kind: inline type: code data: @@ -10,3 +12,5 @@ nodes: nodes: - kind: text text: word + - kind: text + text: "" diff --git a/test/transforms/fixtures/at-range/set-inline-at-range/with-is-void/index.js b/test/transforms/fixtures/at-range/set-inline-at-range/with-is-void/index.js index 9eaec0254..836770cc2 100644 --- a/test/transforms/fixtures/at-range/set-inline-at-range/with-is-void/index.js +++ b/test/transforms/fixtures/at-range/set-inline-at-range/with-is-void/index.js @@ -2,11 +2,11 @@ export default function (state) { const { document, selection } = state const texts = document.getTexts() - const first = texts.first() + const second = texts.get(1) const range = selection.merge({ - anchorKey: first.key, + anchorKey: second.key, anchorOffset: 0, - focusKey: first.key, + focusKey: second.key, focusOffset: 0 }) diff --git a/test/transforms/fixtures/at-range/set-inline-at-range/with-is-void/input.yaml b/test/transforms/fixtures/at-range/set-inline-at-range/with-is-void/input.yaml index f752cee89..8d1a24e00 100644 --- a/test/transforms/fixtures/at-range/set-inline-at-range/with-is-void/input.yaml +++ b/test/transforms/fixtures/at-range/set-inline-at-range/with-is-void/input.yaml @@ -3,8 +3,12 @@ nodes: - kind: block type: paragraph nodes: + - kind: text + text: "" - kind: inline type: link nodes: - kind: text text: word + - kind: text + text: "" diff --git a/test/transforms/fixtures/at-range/split-block-at-range/with-delete-across-blocks-and-inlines/index.js b/test/transforms/fixtures/at-range/split-block-at-range/with-delete-across-blocks-and-inlines/index.js index 1e2bc187d..c6d0bd6d0 100644 --- a/test/transforms/fixtures/at-range/split-block-at-range/with-delete-across-blocks-and-inlines/index.js +++ b/test/transforms/fixtures/at-range/split-block-at-range/with-delete-across-blocks-and-inlines/index.js @@ -2,12 +2,12 @@ export default function (state) { const { document, selection } = state const texts = document.getTexts() - const first = texts.first() - const second = texts.last() + const second = texts.get(1) + const fifth = texts.get(4) const range = selection.merge({ - anchorKey: first.key, + anchorKey: second.key, anchorOffset: 2, - focusKey: second.key, + focusKey: fifth.key, focusOffset: 2 }) diff --git a/test/transforms/fixtures/at-range/split-block-at-range/with-delete-across-blocks-and-inlines/input.yaml b/test/transforms/fixtures/at-range/split-block-at-range/with-delete-across-blocks-and-inlines/input.yaml index 9d4daa75a..102c6529b 100644 --- a/test/transforms/fixtures/at-range/split-block-at-range/with-delete-across-blocks-and-inlines/input.yaml +++ b/test/transforms/fixtures/at-range/split-block-at-range/with-delete-across-blocks-and-inlines/input.yaml @@ -3,16 +3,24 @@ nodes: - kind: block type: paragraph nodes: + - kind: text + text: "" - kind: inline type: one nodes: - kind: text text: word + - kind: text + text: "" - kind: block type: paragraph nodes: + - kind: text + text: "" - kind: inline type: two nodes: - kind: text text: another + - kind: text + text: "" diff --git a/test/transforms/fixtures/at-range/split-block-at-range/with-delete-across-blocks-and-inlines/output.yaml b/test/transforms/fixtures/at-range/split-block-at-range/with-delete-across-blocks-and-inlines/output.yaml index b5fb12019..61d0e7a0a 100644 --- a/test/transforms/fixtures/at-range/split-block-at-range/with-delete-across-blocks-and-inlines/output.yaml +++ b/test/transforms/fixtures/at-range/split-block-at-range/with-delete-across-blocks-and-inlines/output.yaml @@ -3,16 +3,24 @@ nodes: - kind: block type: paragraph nodes: + - kind: text + text: "" - kind: inline type: one nodes: - kind: text text: wo + - kind: text + text: "" - kind: block type: paragraph nodes: + - kind: text + text: "" - kind: inline type: two nodes: - kind: text text: other + - kind: text + text: "" diff --git a/test/transforms/fixtures/at-range/split-block-at-range/with-inline/index.js b/test/transforms/fixtures/at-range/split-block-at-range/with-inline/index.js index 4f999195b..68dc82770 100644 --- a/test/transforms/fixtures/at-range/split-block-at-range/with-inline/index.js +++ b/test/transforms/fixtures/at-range/split-block-at-range/with-inline/index.js @@ -2,11 +2,11 @@ export default function (state) { const { document, selection } = state const texts = document.getTexts() - const first = texts.first() + const second = texts.get(1) const range = selection.merge({ - anchorKey: first.key, + anchorKey: second.key, anchorOffset: 2, - focusKey: first.key, + focusKey: second.key, focusOffset: 2 }) diff --git a/test/transforms/fixtures/at-range/split-block-at-range/with-inline/input.yaml b/test/transforms/fixtures/at-range/split-block-at-range/with-inline/input.yaml index f752cee89..8d1a24e00 100644 --- a/test/transforms/fixtures/at-range/split-block-at-range/with-inline/input.yaml +++ b/test/transforms/fixtures/at-range/split-block-at-range/with-inline/input.yaml @@ -3,8 +3,12 @@ nodes: - kind: block type: paragraph nodes: + - kind: text + text: "" - kind: inline type: link nodes: - kind: text text: word + - kind: text + text: "" diff --git a/test/transforms/fixtures/at-range/split-block-at-range/with-inline/output.yaml b/test/transforms/fixtures/at-range/split-block-at-range/with-inline/output.yaml index f87391c2b..33a5040e4 100644 --- a/test/transforms/fixtures/at-range/split-block-at-range/with-inline/output.yaml +++ b/test/transforms/fixtures/at-range/split-block-at-range/with-inline/output.yaml @@ -3,16 +3,24 @@ nodes: - kind: block type: paragraph nodes: + - kind: text + text: "" - kind: inline type: link nodes: - kind: text text: wo + - kind: text + text: "" - kind: block type: paragraph nodes: + - kind: text + text: "" - kind: inline type: link nodes: - kind: text text: rd + - kind: text + text: "" diff --git a/test/transforms/fixtures/at-range/split-inline-at-range/block-end/index.js b/test/transforms/fixtures/at-range/split-inline-at-range/block-end/index.js index 694554eec..d86d60efa 100644 --- a/test/transforms/fixtures/at-range/split-inline-at-range/block-end/index.js +++ b/test/transforms/fixtures/at-range/split-inline-at-range/block-end/index.js @@ -2,12 +2,12 @@ export default function (state) { const { document, selection } = state const texts = document.getTexts() - const first = texts.first() + const second = texts.get(1) const range = selection.merge({ - anchorKey: first.key, - anchorOffset: first.length, - focusKey: first.key, - focusOffset: first.length + anchorKey: second.key, + anchorOffset: second.length, + focusKey: second.key, + focusOffset: second.length }) return state diff --git a/test/transforms/fixtures/at-range/split-inline-at-range/block-end/input.yaml b/test/transforms/fixtures/at-range/split-inline-at-range/block-end/input.yaml index f752cee89..8d1a24e00 100644 --- a/test/transforms/fixtures/at-range/split-inline-at-range/block-end/input.yaml +++ b/test/transforms/fixtures/at-range/split-inline-at-range/block-end/input.yaml @@ -3,8 +3,12 @@ nodes: - kind: block type: paragraph nodes: + - kind: text + text: "" - kind: inline type: link nodes: - kind: text text: word + - kind: text + text: "" diff --git a/test/transforms/fixtures/at-range/split-inline-at-range/block-end/output.yaml b/test/transforms/fixtures/at-range/split-inline-at-range/block-end/output.yaml index f752cee89..8d1a24e00 100644 --- a/test/transforms/fixtures/at-range/split-inline-at-range/block-end/output.yaml +++ b/test/transforms/fixtures/at-range/split-inline-at-range/block-end/output.yaml @@ -3,8 +3,12 @@ nodes: - kind: block type: paragraph nodes: + - kind: text + text: "" - kind: inline type: link nodes: - kind: text text: word + - kind: text + text: "" diff --git a/test/transforms/fixtures/at-range/split-inline-at-range/block-middle/index.js b/test/transforms/fixtures/at-range/split-inline-at-range/block-middle/index.js index b4d6bb255..204c87c05 100644 --- a/test/transforms/fixtures/at-range/split-inline-at-range/block-middle/index.js +++ b/test/transforms/fixtures/at-range/split-inline-at-range/block-middle/index.js @@ -2,11 +2,11 @@ export default function (state) { const { document, selection } = state const texts = document.getTexts() - const first = texts.first() + const second = texts.get(1) const range = selection.merge({ - anchorKey: first.key, + anchorKey: second.key, anchorOffset: 2, - focusKey: first.key, + focusKey: second.key, focusOffset: 2 }) diff --git a/test/transforms/fixtures/at-range/split-inline-at-range/block-middle/input.yaml b/test/transforms/fixtures/at-range/split-inline-at-range/block-middle/input.yaml index f752cee89..8d1a24e00 100644 --- a/test/transforms/fixtures/at-range/split-inline-at-range/block-middle/input.yaml +++ b/test/transforms/fixtures/at-range/split-inline-at-range/block-middle/input.yaml @@ -3,8 +3,12 @@ nodes: - kind: block type: paragraph nodes: + - kind: text + text: "" - kind: inline type: link nodes: - kind: text text: word + - kind: text + text: "" diff --git a/test/transforms/fixtures/at-range/split-inline-at-range/block-middle/output.yaml b/test/transforms/fixtures/at-range/split-inline-at-range/block-middle/output.yaml index fe8c003f6..a49ed0fbc 100644 --- a/test/transforms/fixtures/at-range/split-inline-at-range/block-middle/output.yaml +++ b/test/transforms/fixtures/at-range/split-inline-at-range/block-middle/output.yaml @@ -3,13 +3,19 @@ nodes: - kind: block type: paragraph nodes: + - kind: text + text: "" - kind: inline type: link nodes: - kind: text text: wo + - kind: text + text: "" - kind: inline type: link nodes: - kind: text text: rd + - kind: text + text: "" diff --git a/test/transforms/fixtures/at-range/split-inline-at-range/block-start/index.js b/test/transforms/fixtures/at-range/split-inline-at-range/block-start/index.js index 5a800d4b5..b9f9aba10 100644 --- a/test/transforms/fixtures/at-range/split-inline-at-range/block-start/index.js +++ b/test/transforms/fixtures/at-range/split-inline-at-range/block-start/index.js @@ -2,11 +2,11 @@ export default function (state) { const { document, selection } = state const texts = document.getTexts() - const first = texts.first() + const second = texts.get(1) const range = selection.merge({ - anchorKey: first.key, + anchorKey: second.key, anchorOffset: 0, - focusKey: first.key, + focusKey: second.key, focusOffset: 0 }) diff --git a/test/transforms/fixtures/at-range/split-inline-at-range/block-start/input.yaml b/test/transforms/fixtures/at-range/split-inline-at-range/block-start/input.yaml index f752cee89..8d1a24e00 100644 --- a/test/transforms/fixtures/at-range/split-inline-at-range/block-start/input.yaml +++ b/test/transforms/fixtures/at-range/split-inline-at-range/block-start/input.yaml @@ -3,8 +3,12 @@ nodes: - kind: block type: paragraph nodes: + - kind: text + text: "" - kind: inline type: link nodes: - kind: text text: word + - kind: text + text: "" diff --git a/test/transforms/fixtures/at-range/split-inline-at-range/block-start/output.yaml b/test/transforms/fixtures/at-range/split-inline-at-range/block-start/output.yaml index f752cee89..8d1a24e00 100644 --- a/test/transforms/fixtures/at-range/split-inline-at-range/block-start/output.yaml +++ b/test/transforms/fixtures/at-range/split-inline-at-range/block-start/output.yaml @@ -3,8 +3,12 @@ nodes: - kind: block type: paragraph nodes: + - kind: text + text: "" - kind: inline type: link nodes: - kind: text text: word + - kind: text + text: "" diff --git a/test/transforms/fixtures/at-range/split-inline-at-range/depth/index.js b/test/transforms/fixtures/at-range/split-inline-at-range/depth/index.js index be5e61186..246aca891 100644 --- a/test/transforms/fixtures/at-range/split-inline-at-range/depth/index.js +++ b/test/transforms/fixtures/at-range/split-inline-at-range/depth/index.js @@ -2,11 +2,11 @@ export default function (state) { const { document, selection } = state const texts = document.getTexts() - const first = texts.first() + const third = texts.get(2) const range = selection.merge({ - anchorKey: first.key, + anchorKey: third.key, anchorOffset: 2, - focusKey: first.key, + focusKey: third.key, focusOffset: 2 }) diff --git a/test/transforms/fixtures/at-range/split-inline-at-range/depth/input.yaml b/test/transforms/fixtures/at-range/split-inline-at-range/depth/input.yaml index 7cf6ea506..cae158867 100644 --- a/test/transforms/fixtures/at-range/split-inline-at-range/depth/input.yaml +++ b/test/transforms/fixtures/at-range/split-inline-at-range/depth/input.yaml @@ -3,11 +3,19 @@ nodes: - kind: block type: paragraph nodes: + - kind: text + text: "" - kind: inline type: link nodes: + - kind: text + text: "" - kind: inline type: link nodes: - kind: text text: word + - kind: text + text: "" + - kind: text + text: "" diff --git a/test/transforms/fixtures/at-range/split-inline-at-range/depth/output.yaml b/test/transforms/fixtures/at-range/split-inline-at-range/depth/output.yaml index 419b1bf8d..219178e5c 100644 --- a/test/transforms/fixtures/at-range/split-inline-at-range/depth/output.yaml +++ b/test/transforms/fixtures/at-range/split-inline-at-range/depth/output.yaml @@ -3,16 +3,26 @@ nodes: - kind: block type: paragraph nodes: + - kind: text + text: "" - kind: inline type: link nodes: + - kind: text + text: "" - kind: inline type: link nodes: - kind: text text: wo + - kind: text + text: "" - kind: inline type: link nodes: - kind: text text: rd + - kind: text + text: "" + - kind: text + text: "" diff --git a/test/transforms/fixtures/at-range/split-inline-at-range/with-delete/index.js b/test/transforms/fixtures/at-range/split-inline-at-range/with-delete/index.js index a9baf98d8..27aaa3dfc 100644 --- a/test/transforms/fixtures/at-range/split-inline-at-range/with-delete/index.js +++ b/test/transforms/fixtures/at-range/split-inline-at-range/with-delete/index.js @@ -2,11 +2,11 @@ export default function (state) { const { document, selection } = state const texts = document.getTexts() - const first = texts.first() + const second = texts.get(1) const range = selection.merge({ - anchorKey: first.key, + anchorKey: second.key, anchorOffset: 1, - focusKey: first.key, + focusKey: second.key, focusOffset: 3 }) diff --git a/test/transforms/fixtures/at-range/split-inline-at-range/with-delete/input.yaml b/test/transforms/fixtures/at-range/split-inline-at-range/with-delete/input.yaml index f752cee89..8d1a24e00 100644 --- a/test/transforms/fixtures/at-range/split-inline-at-range/with-delete/input.yaml +++ b/test/transforms/fixtures/at-range/split-inline-at-range/with-delete/input.yaml @@ -3,8 +3,12 @@ nodes: - kind: block type: paragraph nodes: + - kind: text + text: "" - kind: inline type: link nodes: - kind: text text: word + - kind: text + text: "" diff --git a/test/transforms/fixtures/at-range/split-inline-at-range/with-delete/output.yaml b/test/transforms/fixtures/at-range/split-inline-at-range/with-delete/output.yaml index 771de7f9b..7e3d6a758 100644 --- a/test/transforms/fixtures/at-range/split-inline-at-range/with-delete/output.yaml +++ b/test/transforms/fixtures/at-range/split-inline-at-range/with-delete/output.yaml @@ -3,13 +3,19 @@ nodes: - kind: block type: paragraph nodes: + - kind: text + text: "" - kind: inline type: link nodes: - kind: text text: w + - kind: text + text: "" - kind: inline type: link nodes: - kind: text text: d + - kind: text + text: "" diff --git a/test/transforms/fixtures/at-range/split-inline-at-range/with-marks/index.js b/test/transforms/fixtures/at-range/split-inline-at-range/with-marks/index.js index b4d6bb255..204c87c05 100644 --- a/test/transforms/fixtures/at-range/split-inline-at-range/with-marks/index.js +++ b/test/transforms/fixtures/at-range/split-inline-at-range/with-marks/index.js @@ -2,11 +2,11 @@ export default function (state) { const { document, selection } = state const texts = document.getTexts() - const first = texts.first() + const second = texts.get(1) const range = selection.merge({ - anchorKey: first.key, + anchorKey: second.key, anchorOffset: 2, - focusKey: first.key, + focusKey: second.key, focusOffset: 2 }) diff --git a/test/transforms/fixtures/at-range/split-inline-at-range/with-marks/input.yaml b/test/transforms/fixtures/at-range/split-inline-at-range/with-marks/input.yaml index 4677d20e7..32fff4fc2 100644 --- a/test/transforms/fixtures/at-range/split-inline-at-range/with-marks/input.yaml +++ b/test/transforms/fixtures/at-range/split-inline-at-range/with-marks/input.yaml @@ -3,6 +3,8 @@ nodes: - kind: block type: paragraph nodes: + - kind: text + text: "" - kind: inline type: link nodes: @@ -11,3 +13,5 @@ nodes: - text: word marks: - type: bold + - kind: text + text: "" diff --git a/test/transforms/fixtures/at-range/split-inline-at-range/with-marks/output.yaml b/test/transforms/fixtures/at-range/split-inline-at-range/with-marks/output.yaml index 378b77728..a27b78f4e 100644 --- a/test/transforms/fixtures/at-range/split-inline-at-range/with-marks/output.yaml +++ b/test/transforms/fixtures/at-range/split-inline-at-range/with-marks/output.yaml @@ -3,6 +3,8 @@ nodes: - kind: block type: paragraph nodes: + - kind: text + text: "" - kind: inline type: link nodes: @@ -11,6 +13,8 @@ nodes: - text: wo marks: - type: bold + - kind: text + text: "" - kind: inline type: link nodes: @@ -19,3 +23,5 @@ nodes: - text: rd marks: - type: bold + - kind: text + text: "" diff --git a/test/transforms/fixtures/at-range/toggle-mark-at-range/add-across-inlines/index.js b/test/transforms/fixtures/at-range/toggle-mark-at-range/add-across-inlines/index.js index ab263ac73..58b727acd 100644 --- a/test/transforms/fixtures/at-range/toggle-mark-at-range/add-across-inlines/index.js +++ b/test/transforms/fixtures/at-range/toggle-mark-at-range/add-across-inlines/index.js @@ -2,12 +2,12 @@ export default function (state) { const { document, selection } = state const texts = document.getTexts() - const first = texts.first() - const second = texts.last() + const second = texts.get(1) + const fifth = texts.get(4) const range = selection.merge({ - anchorKey: first.key, + anchorKey: second.key, anchorOffset: 2, - focusKey: second.key, + focusKey: fifth.key, focusOffset: 2 }) diff --git a/test/transforms/fixtures/at-range/toggle-mark-at-range/add-across-inlines/input.yaml b/test/transforms/fixtures/at-range/toggle-mark-at-range/add-across-inlines/input.yaml index 2568c6b66..8cb1b0a19 100644 --- a/test/transforms/fixtures/at-range/toggle-mark-at-range/add-across-inlines/input.yaml +++ b/test/transforms/fixtures/at-range/toggle-mark-at-range/add-across-inlines/input.yaml @@ -3,16 +3,24 @@ nodes: - kind: block type: paragraph nodes: + - kind: text + text: "" - kind: inline type: link nodes: - kind: text text: word + - kind: text + text: "" - kind: block type: paragraph nodes: + - kind: text + text: "" - kind: inline type: link nodes: - kind: text text: another + - kind: text + text: "" diff --git a/test/transforms/fixtures/at-range/toggle-mark-at-range/add-across-inlines/output.yaml b/test/transforms/fixtures/at-range/toggle-mark-at-range/add-across-inlines/output.yaml index 7bf3a7a16..cd34e2769 100644 --- a/test/transforms/fixtures/at-range/toggle-mark-at-range/add-across-inlines/output.yaml +++ b/test/transforms/fixtures/at-range/toggle-mark-at-range/add-across-inlines/output.yaml @@ -3,6 +3,8 @@ nodes: - kind: block type: paragraph nodes: + - kind: text + text: "" - kind: inline type: link nodes: @@ -12,9 +14,13 @@ nodes: - text: rd marks: - type: bold + - kind: text + text: "" - kind: block type: paragraph nodes: + - kind: text + text: "" - kind: inline type: link nodes: @@ -24,3 +30,5 @@ nodes: marks: - type: bold - text: other + - kind: text + text: "" diff --git a/test/transforms/fixtures/at-range/toggle-mark-at-range/remove-across-inlines/index.js b/test/transforms/fixtures/at-range/toggle-mark-at-range/remove-across-inlines/index.js index ab263ac73..58b727acd 100644 --- a/test/transforms/fixtures/at-range/toggle-mark-at-range/remove-across-inlines/index.js +++ b/test/transforms/fixtures/at-range/toggle-mark-at-range/remove-across-inlines/index.js @@ -2,12 +2,12 @@ export default function (state) { const { document, selection } = state const texts = document.getTexts() - const first = texts.first() - const second = texts.last() + const second = texts.get(1) + const fifth = texts.get(4) const range = selection.merge({ - anchorKey: first.key, + anchorKey: second.key, anchorOffset: 2, - focusKey: second.key, + focusKey: fifth.key, focusOffset: 2 }) diff --git a/test/transforms/fixtures/at-range/toggle-mark-at-range/remove-across-inlines/input.yaml b/test/transforms/fixtures/at-range/toggle-mark-at-range/remove-across-inlines/input.yaml index 68d1f01fc..ae18e4221 100644 --- a/test/transforms/fixtures/at-range/toggle-mark-at-range/remove-across-inlines/input.yaml +++ b/test/transforms/fixtures/at-range/toggle-mark-at-range/remove-across-inlines/input.yaml @@ -3,6 +3,8 @@ nodes: - kind: block type: paragraph nodes: + - kind: text + text: "" - kind: inline type: link nodes: @@ -11,9 +13,13 @@ nodes: - text: word marks: - type: bold + - kind: text + text: "" - kind: block type: paragraph nodes: + - kind: text + text: "" - kind: inline type: link nodes: @@ -22,3 +28,5 @@ nodes: - text: another marks: - type: bold + - kind: text + text: "" diff --git a/test/transforms/fixtures/at-range/toggle-mark-at-range/remove-across-inlines/output.yaml b/test/transforms/fixtures/at-range/toggle-mark-at-range/remove-across-inlines/output.yaml index 68568ba65..ebf301182 100644 --- a/test/transforms/fixtures/at-range/toggle-mark-at-range/remove-across-inlines/output.yaml +++ b/test/transforms/fixtures/at-range/toggle-mark-at-range/remove-across-inlines/output.yaml @@ -3,6 +3,8 @@ nodes: - kind: block type: paragraph nodes: + - kind: text + text: "" - kind: inline type: link nodes: @@ -12,9 +14,13 @@ nodes: marks: - type: bold - text: rd + - kind: text + text: "" - kind: block type: paragraph nodes: + - kind: text + text: "" - kind: inline type: link nodes: @@ -24,3 +30,5 @@ nodes: - text: other marks: - type: bold + - kind: text + text: "" diff --git a/test/transforms/fixtures/at-range/unwrap-block-at-range/across-inlines/index.js b/test/transforms/fixtures/at-range/unwrap-block-at-range/across-inlines/index.js index 51951ec7a..a817f3343 100644 --- a/test/transforms/fixtures/at-range/unwrap-block-at-range/across-inlines/index.js +++ b/test/transforms/fixtures/at-range/unwrap-block-at-range/across-inlines/index.js @@ -2,12 +2,12 @@ export default function (state) { const { document, selection } = state const texts = document.getTexts() - const first = texts.first() - const second = texts.last() + const second = texts.get(1) + const fifth = texts.get(4) const range = selection.merge({ - anchorKey: first.key, + anchorKey: second.key, anchorOffset: 2, - focusKey: second.key, + focusKey: fifth.key, focusOffset: 2 }) diff --git a/test/transforms/fixtures/at-range/unwrap-block-at-range/across-inlines/input.yaml b/test/transforms/fixtures/at-range/unwrap-block-at-range/across-inlines/input.yaml index 8a2784628..de0987151 100644 --- a/test/transforms/fixtures/at-range/unwrap-block-at-range/across-inlines/input.yaml +++ b/test/transforms/fixtures/at-range/unwrap-block-at-range/across-inlines/input.yaml @@ -6,16 +6,24 @@ nodes: - kind: block type: paragraph nodes: + - kind: text + text: "" - kind: inline type: link nodes: - kind: text text: word + - kind: text + text: "" - kind: block type: paragraph nodes: + - kind: text + text: "" - kind: inline type: link nodes: - kind: text text: another + - kind: text + text: "" diff --git a/test/transforms/fixtures/at-range/unwrap-block-at-range/across-inlines/output.yaml b/test/transforms/fixtures/at-range/unwrap-block-at-range/across-inlines/output.yaml index 2568c6b66..8cb1b0a19 100644 --- a/test/transforms/fixtures/at-range/unwrap-block-at-range/across-inlines/output.yaml +++ b/test/transforms/fixtures/at-range/unwrap-block-at-range/across-inlines/output.yaml @@ -3,16 +3,24 @@ nodes: - kind: block type: paragraph nodes: + - kind: text + text: "" - kind: inline type: link nodes: - kind: text text: word + - kind: text + text: "" - kind: block type: paragraph nodes: + - kind: text + text: "" - kind: inline type: link nodes: - kind: text text: another + - kind: text + text: "" diff --git a/test/transforms/fixtures/at-range/unwrap-inline-at-range/across-blocks/input.yaml b/test/transforms/fixtures/at-range/unwrap-inline-at-range/across-blocks/input.yaml index 57d48f74f..bcaf8c285 100644 --- a/test/transforms/fixtures/at-range/unwrap-inline-at-range/across-blocks/input.yaml +++ b/test/transforms/fixtures/at-range/unwrap-inline-at-range/across-blocks/input.yaml @@ -10,9 +10,13 @@ nodes: nodes: - kind: text text: rd + - kind: text + text: "" - kind: block type: paragraph nodes: + - kind: text + text: "" - kind: inline type: hashtag nodes: diff --git a/test/transforms/fixtures/at-range/unwrap-inline-at-range/across-inlines/index.js b/test/transforms/fixtures/at-range/unwrap-inline-at-range/across-inlines/index.js index 6b04c6439..36375182e 100644 --- a/test/transforms/fixtures/at-range/unwrap-inline-at-range/across-inlines/index.js +++ b/test/transforms/fixtures/at-range/unwrap-inline-at-range/across-inlines/index.js @@ -2,12 +2,12 @@ export default function (state) { const { document, selection } = state const texts = document.getTexts() - const first = texts.first() - const second = texts.last() + const second = texts.get(1) + const thirteenth = texts.get(12) const range = selection.merge({ - anchorKey: first.key, + anchorKey: second.key, anchorOffset: 2, - focusKey: second.key, + focusKey: thirteenth.key, focusOffset: 2 }) diff --git a/test/transforms/fixtures/at-range/unwrap-inline-at-range/across-inlines/input.yaml b/test/transforms/fixtures/at-range/unwrap-inline-at-range/across-inlines/input.yaml index ac1ce70ca..613495c0e 100644 --- a/test/transforms/fixtures/at-range/unwrap-inline-at-range/across-inlines/input.yaml +++ b/test/transforms/fixtures/at-range/unwrap-inline-at-range/across-inlines/input.yaml @@ -3,29 +3,47 @@ nodes: - kind: block type: paragraph nodes: + - kind: text + text: "" - kind: inline type: link nodes: - kind: text text: wo + - kind: text + text: "" - kind: inline type: hashtag nodes: + - kind: text + text: "" - kind: inline type: link nodes: - kind: text text: rd + - kind: text + text: "" + - kind: text + text: "" - kind: inline type: hashtag nodes: + - kind: text + text: "" - kind: inline type: link nodes: - kind: text text: an + - kind: text + text: "" + - kind: text + text: "" - kind: inline type: link nodes: - kind: text text: other + - kind: text + text: "" diff --git a/test/transforms/fixtures/at-range/unwrap-inline-at-range/across-inlines/output.yaml b/test/transforms/fixtures/at-range/unwrap-inline-at-range/across-inlines/output.yaml index 578e6416e..c6156e3fd 100644 --- a/test/transforms/fixtures/at-range/unwrap-inline-at-range/across-inlines/output.yaml +++ b/test/transforms/fixtures/at-range/unwrap-inline-at-range/across-inlines/output.yaml @@ -3,23 +3,33 @@ nodes: - kind: block type: paragraph nodes: + - kind: text + text: "" - kind: inline type: link nodes: - kind: text text: wo + - kind: text + text: "" - kind: inline type: link nodes: - kind: text text: rd + - kind: text + text: "" - kind: inline type: link nodes: - kind: text text: an + - kind: text + text: "" - kind: inline type: link nodes: - kind: text text: other + - kind: text + text: "" diff --git a/test/transforms/fixtures/at-range/unwrap-inline-at-range/with-object/index.js b/test/transforms/fixtures/at-range/unwrap-inline-at-range/with-object/index.js index 4f3f594cc..41a3021a2 100644 --- a/test/transforms/fixtures/at-range/unwrap-inline-at-range/with-object/index.js +++ b/test/transforms/fixtures/at-range/unwrap-inline-at-range/with-object/index.js @@ -3,12 +3,12 @@ export default function (state) { const { document, selection } = state const texts = document.getTexts() const first = texts.first() - const last = texts.get(1) + const last = texts.last() const range = selection.merge({ anchorKey: first.key, anchorOffset: 1, focusKey: last.key, - focusOffset: 2 + focusOffset: 0 }) return state diff --git a/test/transforms/fixtures/at-range/unwrap-inline-at-range/with-object/input.yaml b/test/transforms/fixtures/at-range/unwrap-inline-at-range/with-object/input.yaml index bea41d2de..992b6877b 100644 --- a/test/transforms/fixtures/at-range/unwrap-inline-at-range/with-object/input.yaml +++ b/test/transforms/fixtures/at-range/unwrap-inline-at-range/with-object/input.yaml @@ -10,6 +10,8 @@ nodes: data: key: one nodes: + - kind: text + text: "" - kind: inline type: hashtag data: @@ -17,5 +19,7 @@ nodes: nodes: - kind: text text: or + - kind: text + text: "" - kind: text text: d diff --git a/test/transforms/fixtures/at-range/wrap-block-at-range/across-inlines/index.js b/test/transforms/fixtures/at-range/wrap-block-at-range/across-inlines/index.js index cd110a745..456ad1d7e 100644 --- a/test/transforms/fixtures/at-range/wrap-block-at-range/across-inlines/index.js +++ b/test/transforms/fixtures/at-range/wrap-block-at-range/across-inlines/index.js @@ -2,12 +2,12 @@ export default function (state) { const { document, selection } = state const texts = document.getTexts() - const first = texts.first() - const second = texts.last() + const second = texts.get(1) + const fifth = texts.get(4) const range = selection.merge({ - anchorKey: first.key, + anchorKey: second.key, anchorOffset: 2, - focusKey: second.key, + focusKey: fifth.key, focusOffset: 2 }) diff --git a/test/transforms/fixtures/at-range/wrap-block-at-range/across-inlines/input.yaml b/test/transforms/fixtures/at-range/wrap-block-at-range/across-inlines/input.yaml index 2568c6b66..8cb1b0a19 100644 --- a/test/transforms/fixtures/at-range/wrap-block-at-range/across-inlines/input.yaml +++ b/test/transforms/fixtures/at-range/wrap-block-at-range/across-inlines/input.yaml @@ -3,16 +3,24 @@ nodes: - kind: block type: paragraph nodes: + - kind: text + text: "" - kind: inline type: link nodes: - kind: text text: word + - kind: text + text: "" - kind: block type: paragraph nodes: + - kind: text + text: "" - kind: inline type: link nodes: - kind: text text: another + - kind: text + text: "" diff --git a/test/transforms/fixtures/at-range/wrap-block-at-range/across-inlines/output.yaml b/test/transforms/fixtures/at-range/wrap-block-at-range/across-inlines/output.yaml index 8a2784628..de0987151 100644 --- a/test/transforms/fixtures/at-range/wrap-block-at-range/across-inlines/output.yaml +++ b/test/transforms/fixtures/at-range/wrap-block-at-range/across-inlines/output.yaml @@ -6,16 +6,24 @@ nodes: - kind: block type: paragraph nodes: + - kind: text + text: "" - kind: inline type: link nodes: - kind: text text: word + - kind: text + text: "" - kind: block type: paragraph nodes: + - kind: text + text: "" - kind: inline type: link nodes: - kind: text text: another + - kind: text + text: "" diff --git a/test/transforms/fixtures/at-range/wrap-inline-at-range/across-blocks/output.yaml b/test/transforms/fixtures/at-range/wrap-inline-at-range/across-blocks/output.yaml index 57d48f74f..bcaf8c285 100644 --- a/test/transforms/fixtures/at-range/wrap-inline-at-range/across-blocks/output.yaml +++ b/test/transforms/fixtures/at-range/wrap-inline-at-range/across-blocks/output.yaml @@ -10,9 +10,13 @@ nodes: nodes: - kind: text text: rd + - kind: text + text: "" - kind: block type: paragraph nodes: + - kind: text + text: "" - kind: inline type: hashtag nodes: diff --git a/test/transforms/fixtures/at-range/wrap-inline-at-range/across-inlines/index.js b/test/transforms/fixtures/at-range/wrap-inline-at-range/across-inlines/index.js index fa4ca6219..489405599 100644 --- a/test/transforms/fixtures/at-range/wrap-inline-at-range/across-inlines/index.js +++ b/test/transforms/fixtures/at-range/wrap-inline-at-range/across-inlines/index.js @@ -2,12 +2,12 @@ export default function (state) { const { document, selection } = state const texts = document.getTexts() - const first = texts.first() - const second = texts.last() + const second = texts.get(1) + const fourth = texts.get(3) const range = selection.merge({ - anchorKey: first.key, + anchorKey: second.key, anchorOffset: 2, - focusKey: second.key, + focusKey: fourth.key, focusOffset: 2 }) diff --git a/test/transforms/fixtures/at-range/wrap-inline-at-range/across-inlines/input.yaml b/test/transforms/fixtures/at-range/wrap-inline-at-range/across-inlines/input.yaml index c17ccbcf2..d2906ca8e 100644 --- a/test/transforms/fixtures/at-range/wrap-inline-at-range/across-inlines/input.yaml +++ b/test/transforms/fixtures/at-range/wrap-inline-at-range/across-inlines/input.yaml @@ -3,13 +3,19 @@ nodes: - kind: block type: paragraph nodes: + - kind: text + text: "" - kind: inline type: link nodes: - kind: text text: word + - kind: text + text: "" - kind: inline type: link nodes: - kind: text text: another + - kind: text + text: "" diff --git a/test/transforms/fixtures/at-range/wrap-inline-at-range/across-inlines/output.yaml b/test/transforms/fixtures/at-range/wrap-inline-at-range/across-inlines/output.yaml index a50a2033d..c3816df06 100644 --- a/test/transforms/fixtures/at-range/wrap-inline-at-range/across-inlines/output.yaml +++ b/test/transforms/fixtures/at-range/wrap-inline-at-range/across-inlines/output.yaml @@ -3,26 +3,40 @@ nodes: - kind: block type: paragraph nodes: + - kind: text + text: "" - kind: inline type: link nodes: - kind: text text: wo + - kind: text + text: "" - kind: inline type: hashtag nodes: + - kind: text + text: "" - kind: inline type: link nodes: - kind: text text: rd + - kind: text + text: "" - kind: inline type: link nodes: - kind: text text: an + - kind: text + text: "" + - kind: text + text: "" - kind: inline type: link nodes: - kind: text text: other + - kind: text + text: "" diff --git a/test/transforms/fixtures/at-range/wrap-inline-at-range/wrap-inline-void/output.yaml b/test/transforms/fixtures/at-range/wrap-inline-at-range/wrap-inline-void/output.yaml index 8bf924c83..62e8605d5 100644 --- a/test/transforms/fixtures/at-range/wrap-inline-at-range/wrap-inline-void/output.yaml +++ b/test/transforms/fixtures/at-range/wrap-inline-at-range/wrap-inline-void/output.yaml @@ -3,6 +3,8 @@ nodes: - kind: block type: paragraph nodes: + - kind: text + text: "" - kind: inline type: link nodes: @@ -13,3 +15,5 @@ nodes: type: image - kind: text text: "" + - kind: text + text: "" diff --git a/test/transforms/fixtures/at-range/wrap-text-at-range/across-inlines/index.js b/test/transforms/fixtures/at-range/wrap-text-at-range/across-inlines/index.js index 745f84289..ec61c42e7 100644 --- a/test/transforms/fixtures/at-range/wrap-text-at-range/across-inlines/index.js +++ b/test/transforms/fixtures/at-range/wrap-text-at-range/across-inlines/index.js @@ -2,12 +2,12 @@ export default function (state) { const { document, selection } = state const texts = document.getTexts() - const first = texts.first() - const last = texts.last() + const second = texts.get(1) + const fourth = texts.get(3) const range = selection.merge({ - anchorKey: first.key, + anchorKey: second.key, anchorOffset: 2, - focusKey: last.key, + focusKey: fourth.key, focusOffset: 2 }) diff --git a/test/transforms/fixtures/at-range/wrap-text-at-range/across-inlines/input.yaml b/test/transforms/fixtures/at-range/wrap-text-at-range/across-inlines/input.yaml index c17ccbcf2..d2906ca8e 100644 --- a/test/transforms/fixtures/at-range/wrap-text-at-range/across-inlines/input.yaml +++ b/test/transforms/fixtures/at-range/wrap-text-at-range/across-inlines/input.yaml @@ -3,13 +3,19 @@ nodes: - kind: block type: paragraph nodes: + - kind: text + text: "" - kind: inline type: link nodes: - kind: text text: word + - kind: text + text: "" - kind: inline type: link nodes: - kind: text text: another + - kind: text + text: "" diff --git a/test/transforms/fixtures/at-range/wrap-text-at-range/across-inlines/output.yaml b/test/transforms/fixtures/at-range/wrap-text-at-range/across-inlines/output.yaml index 780ee42bd..6077e6942 100644 --- a/test/transforms/fixtures/at-range/wrap-text-at-range/across-inlines/output.yaml +++ b/test/transforms/fixtures/at-range/wrap-text-at-range/across-inlines/output.yaml @@ -3,13 +3,19 @@ nodes: - kind: block type: paragraph nodes: + - kind: text + text: "" - kind: inline type: link nodes: - kind: text text: wo[[rd + - kind: text + text: "" - kind: inline type: link nodes: - kind: text text: an]]other + - kind: text + text: "" diff --git a/test/transforms/fixtures/by-key/join-node-by-key/text/output.yaml b/test/transforms/fixtures/by-key/join-node-by-key/text/output.yaml index 434082dfa..7cbc048b0 100644 --- a/test/transforms/fixtures/by-key/join-node-by-key/text/output.yaml +++ b/test/transforms/fixtures/by-key/join-node-by-key/text/output.yaml @@ -11,3 +11,5 @@ nodes: nodes: - kind: text text: two + - kind: text + text: "" diff --git a/test/transforms/fixtures/by-key/move-node-by-key/inline/index.js b/test/transforms/fixtures/by-key/move-node-by-key/inline/index.js index 5227152ee..da980c757 100644 --- a/test/transforms/fixtures/by-key/move-node-by-key/inline/index.js +++ b/test/transforms/fixtures/by-key/move-node-by-key/inline/index.js @@ -6,6 +6,6 @@ export default function (state) { return state .transform() - .moveNodeByKey(first.key, block.key, 1) + .moveNodeByKey(first.key, block.key, 3) .apply() } diff --git a/test/transforms/fixtures/by-key/move-node-by-key/inline/input.yaml b/test/transforms/fixtures/by-key/move-node-by-key/inline/input.yaml index 496aeb02a..a4ec4789b 100644 --- a/test/transforms/fixtures/by-key/move-node-by-key/inline/input.yaml +++ b/test/transforms/fixtures/by-key/move-node-by-key/inline/input.yaml @@ -3,13 +3,19 @@ nodes: - kind: block type: paragraph nodes: + - kind: text + text: "" - kind: inline type: link nodes: - kind: text text: one + - kind: text + text: "" - kind: inline type: link nodes: - kind: text text: two + - kind: text + text: "" diff --git a/test/transforms/fixtures/by-key/move-node-by-key/inline/output.yaml b/test/transforms/fixtures/by-key/move-node-by-key/inline/output.yaml index 6f46511d3..e314c499f 100644 --- a/test/transforms/fixtures/by-key/move-node-by-key/inline/output.yaml +++ b/test/transforms/fixtures/by-key/move-node-by-key/inline/output.yaml @@ -3,13 +3,19 @@ nodes: - kind: block type: paragraph nodes: + - kind: text + text: "" - kind: inline type: link nodes: - kind: text text: two + - kind: text + text: "" - kind: inline type: link nodes: - kind: text text: one + - kind: text + text: "" diff --git a/test/transforms/fixtures/by-key/remove-node-by-key/inline/index.js b/test/transforms/fixtures/by-key/remove-node-by-key/inline/index.js index c3cb4b8f1..7c2a2dc21 100644 --- a/test/transforms/fixtures/by-key/remove-node-by-key/inline/index.js +++ b/test/transforms/fixtures/by-key/remove-node-by-key/inline/index.js @@ -4,7 +4,7 @@ import assert from 'assert' export default function (state) { const { document, selection } = state const texts = document.getTexts() - const secondText = texts.get(1) + const secondText = texts.get(3) const nextSelection = selection.merge({ anchorKey: secondText.key, diff --git a/test/transforms/fixtures/by-key/remove-node-by-key/inline/input.yaml b/test/transforms/fixtures/by-key/remove-node-by-key/inline/input.yaml index cd7017235..38556fb13 100644 --- a/test/transforms/fixtures/by-key/remove-node-by-key/inline/input.yaml +++ b/test/transforms/fixtures/by-key/remove-node-by-key/inline/input.yaml @@ -3,12 +3,16 @@ nodes: - kind: block type: paragraph nodes: + - kind: text + text: "" - kind: inline type: link key: todelete nodes: - kind: text text: removed + - kind: text + text: "" - kind: block type: paragraph nodes: diff --git a/test/transforms/fixtures/by-key/remove-text-by-key/adjacent-non-void-inlines/index.js b/test/transforms/fixtures/by-key/remove-text-by-key/adjacent-non-void-inlines/index.js index c5deeb445..d6ef2ef6b 100644 --- a/test/transforms/fixtures/by-key/remove-text-by-key/adjacent-non-void-inlines/index.js +++ b/test/transforms/fixtures/by-key/remove-text-by-key/adjacent-non-void-inlines/index.js @@ -1,10 +1,10 @@ export default function (state) { - const { document, selection } = state - const second = document.getTexts().get(1) + const { document } = state + const third = document.getTexts().get(2) return state .transform() - .removeTextByKey(second.key, 0, 1) + .removeTextByKey(third.key, 0, 1) .apply() } diff --git a/test/transforms/fixtures/by-key/remove-text-by-key/adjacent-non-void-inlines/input.yaml b/test/transforms/fixtures/by-key/remove-text-by-key/adjacent-non-void-inlines/input.yaml index a78b31f17..35f4b150d 100644 --- a/test/transforms/fixtures/by-key/remove-text-by-key/adjacent-non-void-inlines/input.yaml +++ b/test/transforms/fixtures/by-key/remove-text-by-key/adjacent-non-void-inlines/input.yaml @@ -3,6 +3,8 @@ nodes: - kind: block type: paragraph nodes: + - kind: text + text: "" - kind: inline type: link nodes: @@ -15,3 +17,5 @@ nodes: nodes: - kind: text text: two + - kind: text + text: "" diff --git a/test/transforms/fixtures/by-key/remove-text-by-key/adjacent-non-void-inlines/output.yaml b/test/transforms/fixtures/by-key/remove-text-by-key/adjacent-non-void-inlines/output.yaml index 496aeb02a..a4ec4789b 100644 --- a/test/transforms/fixtures/by-key/remove-text-by-key/adjacent-non-void-inlines/output.yaml +++ b/test/transforms/fixtures/by-key/remove-text-by-key/adjacent-non-void-inlines/output.yaml @@ -3,13 +3,19 @@ nodes: - kind: block type: paragraph nodes: + - kind: text + text: "" - kind: inline type: link nodes: - kind: text text: one + - kind: text + text: "" - kind: inline type: link nodes: - kind: text text: two + - kind: text + text: "" diff --git a/test/transforms/fixtures/by-key/remove-text-by-key/inline-last-character-deep/index.js b/test/transforms/fixtures/by-key/remove-text-by-key/inline-last-character-deep/index.js index 955d83d1b..d6ef2ef6b 100644 --- a/test/transforms/fixtures/by-key/remove-text-by-key/inline-last-character-deep/index.js +++ b/test/transforms/fixtures/by-key/remove-text-by-key/inline-last-character-deep/index.js @@ -1,10 +1,10 @@ export default function (state) { - const { document, selection } = state - const first = document.getTexts().first() + const { document } = state + const third = document.getTexts().get(2) return state .transform() - .removeTextByKey(first.key, 0, 1) + .removeTextByKey(third.key, 0, 1) .apply() } diff --git a/test/transforms/fixtures/by-key/remove-text-by-key/inline-last-character-deep/input.yaml b/test/transforms/fixtures/by-key/remove-text-by-key/inline-last-character-deep/input.yaml index 2acb3f5f0..c7ff101e4 100644 --- a/test/transforms/fixtures/by-key/remove-text-by-key/inline-last-character-deep/input.yaml +++ b/test/transforms/fixtures/by-key/remove-text-by-key/inline-last-character-deep/input.yaml @@ -3,11 +3,19 @@ nodes: - kind: block type: paragraph nodes: + - kind: text + text: "" - kind: inline type: link nodes: + - kind: text + text: "" - kind: inline type: hashtag nodes: - kind: text text: a + - kind: text + text: "" + - kind: text + text: "" diff --git a/test/transforms/fixtures/by-key/remove-text-by-key/inline-last-character/index.js b/test/transforms/fixtures/by-key/remove-text-by-key/inline-last-character/index.js index 955d83d1b..53749103c 100644 --- a/test/transforms/fixtures/by-key/remove-text-by-key/inline-last-character/index.js +++ b/test/transforms/fixtures/by-key/remove-text-by-key/inline-last-character/index.js @@ -1,10 +1,10 @@ export default function (state) { - const { document, selection } = state - const first = document.getTexts().first() + const { document } = state + const second = document.getTexts().get(1) return state .transform() - .removeTextByKey(first.key, 0, 1) + .removeTextByKey(second.key, 0, 1) .apply() } diff --git a/test/transforms/fixtures/by-key/remove-text-by-key/inline-last-character/input.yaml b/test/transforms/fixtures/by-key/remove-text-by-key/inline-last-character/input.yaml index 8001e3ad1..e00d9ca1c 100644 --- a/test/transforms/fixtures/by-key/remove-text-by-key/inline-last-character/input.yaml +++ b/test/transforms/fixtures/by-key/remove-text-by-key/inline-last-character/input.yaml @@ -3,8 +3,12 @@ nodes: - kind: block type: paragraph nodes: + - kind: text + text: "" - kind: inline type: link nodes: - kind: text text: a + - kind: text + text: "" diff --git a/test/transforms/fixtures/by-key/remove-text-by-key/inline/index.js b/test/transforms/fixtures/by-key/remove-text-by-key/inline/index.js index b99ee839d..4f7e98169 100644 --- a/test/transforms/fixtures/by-key/remove-text-by-key/inline/index.js +++ b/test/transforms/fixtures/by-key/remove-text-by-key/inline/index.js @@ -1,10 +1,10 @@ export default function (state) { const { document, selection } = state - const first = document.getTexts().first() + const second = document.getTexts().get(1) return state .transform() - .removeTextByKey(first.key, 3, 1) + .removeTextByKey(second.key, 3, 1) .apply() } diff --git a/test/transforms/fixtures/by-key/remove-text-by-key/inline/input.yaml b/test/transforms/fixtures/by-key/remove-text-by-key/inline/input.yaml index f752cee89..8d1a24e00 100644 --- a/test/transforms/fixtures/by-key/remove-text-by-key/inline/input.yaml +++ b/test/transforms/fixtures/by-key/remove-text-by-key/inline/input.yaml @@ -3,8 +3,12 @@ nodes: - kind: block type: paragraph nodes: + - kind: text + text: "" - kind: inline type: link nodes: - kind: text text: word + - kind: text + text: "" diff --git a/test/transforms/fixtures/by-key/remove-text-by-key/inline/output.yaml b/test/transforms/fixtures/by-key/remove-text-by-key/inline/output.yaml index e0e015d73..87f086f36 100644 --- a/test/transforms/fixtures/by-key/remove-text-by-key/inline/output.yaml +++ b/test/transforms/fixtures/by-key/remove-text-by-key/inline/output.yaml @@ -3,8 +3,12 @@ nodes: - kind: block type: paragraph nodes: + - kind: text + text: "" - kind: inline type: link nodes: - kind: text text: wor + - kind: text + text: "" diff --git a/test/transforms/fixtures/by-key/remove-text-by-key/next-void-inline/index.js b/test/transforms/fixtures/by-key/remove-text-by-key/next-void-inline/index.js index c5deeb445..d6ef2ef6b 100644 --- a/test/transforms/fixtures/by-key/remove-text-by-key/next-void-inline/index.js +++ b/test/transforms/fixtures/by-key/remove-text-by-key/next-void-inline/index.js @@ -1,10 +1,10 @@ export default function (state) { - const { document, selection } = state - const second = document.getTexts().get(1) + const { document } = state + const third = document.getTexts().get(2) return state .transform() - .removeTextByKey(second.key, 0, 1) + .removeTextByKey(third.key, 0, 1) .apply() } diff --git a/test/transforms/fixtures/by-key/remove-text-by-key/next-void-inline/input.yaml b/test/transforms/fixtures/by-key/remove-text-by-key/next-void-inline/input.yaml index 739e5c59f..8f6a5f707 100644 --- a/test/transforms/fixtures/by-key/remove-text-by-key/next-void-inline/input.yaml +++ b/test/transforms/fixtures/by-key/remove-text-by-key/next-void-inline/input.yaml @@ -3,6 +3,8 @@ nodes: - kind: block type: paragraph nodes: + - kind: text + text: "" - kind: inline type: link nodes: diff --git a/test/transforms/fixtures/by-key/remove-text-by-key/next-void-inline/output.yaml b/test/transforms/fixtures/by-key/remove-text-by-key/next-void-inline/output.yaml index ebb1fd4d6..06ebbcdda 100644 --- a/test/transforms/fixtures/by-key/remove-text-by-key/next-void-inline/output.yaml +++ b/test/transforms/fixtures/by-key/remove-text-by-key/next-void-inline/output.yaml @@ -3,11 +3,15 @@ nodes: - kind: block type: paragraph nodes: + - kind: text + text: "" - kind: inline type: link nodes: - kind: text text: one + - kind: text + text: "" - kind: inline type: image isVoid: true diff --git a/test/transforms/fixtures/by-key/remove-text-by-key/previous-void-inline/input.yaml b/test/transforms/fixtures/by-key/remove-text-by-key/previous-void-inline/input.yaml index d468b8878..13eb270be 100644 --- a/test/transforms/fixtures/by-key/remove-text-by-key/previous-void-inline/input.yaml +++ b/test/transforms/fixtures/by-key/remove-text-by-key/previous-void-inline/input.yaml @@ -15,3 +15,5 @@ nodes: nodes: - kind: text text: two + - kind: text + text: "" diff --git a/test/transforms/fixtures/by-key/remove-text-by-key/previous-void-inline/output.yaml b/test/transforms/fixtures/by-key/remove-text-by-key/previous-void-inline/output.yaml index 2a4137d88..e0778a790 100644 --- a/test/transforms/fixtures/by-key/remove-text-by-key/previous-void-inline/output.yaml +++ b/test/transforms/fixtures/by-key/remove-text-by-key/previous-void-inline/output.yaml @@ -8,8 +8,12 @@ nodes: - kind: inline type: image isVoid: true + - kind: text + text: "" - kind: inline type: link nodes: - kind: text text: two + - kind: text + text: "" diff --git a/test/transforms/fixtures/by-key/unwrap-inline-by-key/single-block/input.yaml b/test/transforms/fixtures/by-key/unwrap-inline-by-key/single-block/input.yaml index 4a8715778..b747b8209 100644 --- a/test/transforms/fixtures/by-key/unwrap-inline-by-key/single-block/input.yaml +++ b/test/transforms/fixtures/by-key/unwrap-inline-by-key/single-block/input.yaml @@ -17,3 +17,5 @@ nodes: nodes: - kind: text text: another + - kind: text + text: "" diff --git a/test/transforms/fixtures/by-key/unwrap-inline-by-key/single-block/output.yaml b/test/transforms/fixtures/by-key/unwrap-inline-by-key/single-block/output.yaml index f5dba7769..a0e1edb43 100644 --- a/test/transforms/fixtures/by-key/unwrap-inline-by-key/single-block/output.yaml +++ b/test/transforms/fixtures/by-key/unwrap-inline-by-key/single-block/output.yaml @@ -10,3 +10,5 @@ nodes: nodes: - kind: text text: another + - kind: text + text: "" diff --git a/test/transforms/fixtures/by-key/wrap-block-by-key/block-node/input.yaml b/test/transforms/fixtures/by-key/wrap-block-by-key/block-node/input.yaml index fa5558732..91989525f 100644 --- a/test/transforms/fixtures/by-key/wrap-block-by-key/block-node/input.yaml +++ b/test/transforms/fixtures/by-key/wrap-block-by-key/block-node/input.yaml @@ -4,13 +4,8 @@ nodes: type: paragraph nodes: - kind: block - key: 'key' + key: key type: code nodes: - kind: text text: some code - - kind: inline - type: link - nodes: - - kind: text - text: text diff --git a/test/transforms/fixtures/by-key/wrap-block-by-key/block-node/output.yaml b/test/transforms/fixtures/by-key/wrap-block-by-key/block-node/output.yaml index b865d3cfb..20ceda949 100644 --- a/test/transforms/fixtures/by-key/wrap-block-by-key/block-node/output.yaml +++ b/test/transforms/fixtures/by-key/wrap-block-by-key/block-node/output.yaml @@ -11,8 +11,3 @@ nodes: nodes: - kind: text text: some code - - kind: inline - type: link - nodes: - - kind: text - text: text diff --git a/test/transforms/fixtures/by-key/wrap-block-by-key/text-node/input.yaml b/test/transforms/fixtures/by-key/wrap-block-by-key/text-node/input.yaml index 32312603d..30f875858 100644 --- a/test/transforms/fixtures/by-key/wrap-block-by-key/text-node/input.yaml +++ b/test/transforms/fixtures/by-key/wrap-block-by-key/text-node/input.yaml @@ -4,10 +4,5 @@ nodes: type: paragraph nodes: - kind: text - key: 'key' + key: key text: some - - kind: inline - type: link - nodes: - - kind: text - text: text \ No newline at end of file diff --git a/test/transforms/fixtures/by-key/wrap-block-by-key/text-node/output.yaml b/test/transforms/fixtures/by-key/wrap-block-by-key/text-node/output.yaml index 5a97feaf7..917f031bd 100644 --- a/test/transforms/fixtures/by-key/wrap-block-by-key/text-node/output.yaml +++ b/test/transforms/fixtures/by-key/wrap-block-by-key/text-node/output.yaml @@ -8,8 +8,3 @@ nodes: nodes: - kind: text text: some - - kind: inline - type: link - nodes: - - kind: text - text: text