ianstormtaylor / slate

A completely customizable framework for building rich text editors. (Currently in beta.)
http://slatejs.org
MIT License
30.03k stars 3.26k forks source link

unwrap nodes #3636

Open kocka5 opened 4 years ago

kocka5 commented 4 years ago

maybe bug

Slate: 0.57.1

I created test, which failed:

/** @jsx jsx */

import { Transforms } from 'slate'
import { jsx } from '../../..'

export const run = editor => {
  Transforms.unwrapNodes(editor, { match: n => n.a })
}

export const input = (
  <editor>
    <block a>
      <block>
        <block a>
          <cursor />
          word
        </block>
      </block>
    </block>
  </editor>
)

export const output = (
  <editor>
    <block>
      <cursor />
      word
    </block>
  </editor>
)

Thanks Pavel

cameracker commented 4 years ago

Hey @kocka5 could you describe how this test failed?