diff --git a/docs/reference/models/transform.md b/docs/reference/models/transform.md index 832574717..49d8b4576 100644 --- a/docs/reference/models/transform.md +++ b/docs/reference/models/transform.md @@ -57,7 +57,6 @@ Transform methods can either operate on the [`Document`](./document.md), the [`S - [`setMarkByKey`](#setmarkbykey) - [`setNodeByKey`](#setnodebykey) - [`splitNodeByKey`](#splitnodebykey) - - [`unwrapInlineByKey`](#unwrapinlinebykey) - [Document Transforms](#document-transforms) - [`deleteAtRange`](#deleteatrange) - [`deleteBackwardAtRange`](#deletebackwardatrange) @@ -318,12 +317,6 @@ Set a dictionary of `properties` on a [`Node`](./node.md) by its `key`. For conv Split a node by its `key` at an `offset`. -### `unwrapInlineByKey` -`unwrapInlineByKey(key: String, properties: Object) => Transform`
-`unwrapInlineByKey(key: String, type: String) => Transform` - -Unwrap all inner content of an [`Inline`](./inline.md) node that match `properties`. For convenience, you can pass a `type` string or `properties` object. - ## Document Transforms ### `deleteBackwardAtRange` diff --git a/src/transforms/by-key.js b/src/transforms/by-key.js index 20895bdba..fbed4b86c 100644 --- a/src/transforms/by-key.js +++ b/src/transforms/by-key.js @@ -241,21 +241,3 @@ export function splitNodeByKey(transform, key, offset) { return transform.splitNodeOperation(path, offset) } - -/** - * Unwrap content from an inline parent with `properties`. - * - * @param {Transform} transform - * @param {String} key - * @param {Object or String} properties - * @return {Transform} - */ - -export function unwrapInlineByKey(transform, key, properties) { - const { state } = transform - const { document, selection } = state - const node = document.assertDescendant(key) - const range = selection.moveToRangeOf(node) - - return transform.unwrapInline(range, properties) -} diff --git a/test/transforms/fixtures/by-key/unwrap-inline/single-block/index.js b/test/transforms/fixtures/by-key/unwrap-inline/single-block/index.js deleted file mode 100644 index 150a8fcf8..000000000 --- a/test/transforms/fixtures/by-key/unwrap-inline/single-block/index.js +++ /dev/null @@ -1,14 +0,0 @@ - -import assert from 'assert' - -export default function (state) { - const { document, selection } = state - const inline = document.assertPath([0, 1]) - - const next = state - .transform() - .unwrapInlineByKey(inline.key, 'hashtag') - .apply() - - return next -} diff --git a/test/transforms/fixtures/by-key/unwrap-inline/single-block/input.yaml b/test/transforms/fixtures/by-key/unwrap-inline/single-block/input.yaml deleted file mode 100644 index 7bfbe8b4b..000000000 --- a/test/transforms/fixtures/by-key/unwrap-inline/single-block/input.yaml +++ /dev/null @@ -1,14 +0,0 @@ - -nodes: - - kind: block - type: paragraph - nodes: - - kind: text - text: w - - kind: inline - type: hashtag - nodes: - - kind: text - text: or - - kind: text - text: d diff --git a/test/transforms/fixtures/by-key/unwrap-inline/single-block/output.yaml b/test/transforms/fixtures/by-key/unwrap-inline/single-block/output.yaml deleted file mode 100644 index 27f668fe2..000000000 --- a/test/transforms/fixtures/by-key/unwrap-inline/single-block/output.yaml +++ /dev/null @@ -1,7 +0,0 @@ - -nodes: - - kind: block - type: paragraph - nodes: - - kind: text - text: word