mirror of
https://github.com/ianstormtaylor/slate.git
synced 2025-04-14 18:32:01 +02:00
Update wrapNodes to use lowest mode and create passing test. (#3579)
* Update wrapNodes to use lowest mode and create passing test. * Add .idea to .gitignore. * Restore wrapNodes/inline/inline-across.js test. Co-authored-by: Brent Farese <brentfarese@gmail.com>
This commit is contained in:
parent
ddef719467
commit
217b84ff1f
3
.gitignore
vendored
3
.gitignore
vendored
@ -1,10 +1,11 @@
|
||||
*.log
|
||||
.next/
|
||||
.vscode/
|
||||
.idea/
|
||||
build/
|
||||
dist/
|
||||
lib/
|
||||
node_modules/
|
||||
packages/*/yarn.lock
|
||||
site/out/
|
||||
tmp/
|
||||
tmp/
|
||||
|
@ -795,7 +795,7 @@ export const NodeTransforms = {
|
||||
match: editor.isInline(element)
|
||||
? n => Editor.isBlock(editor, n)
|
||||
: n => Editor.isEditor(n),
|
||||
mode: 'highest',
|
||||
mode: 'lowest',
|
||||
voids,
|
||||
})
|
||||
)
|
||||
|
@ -0,0 +1,66 @@
|
||||
/** @jsx jsx */
|
||||
|
||||
import { Transforms } from 'slate'
|
||||
import { jsx } from '../../..'
|
||||
|
||||
export const run = editor => {
|
||||
Transforms.wrapNodes(editor, <inline a />)
|
||||
}
|
||||
|
||||
export const input = (
|
||||
<editor>
|
||||
<block>
|
||||
<block>
|
||||
<text />
|
||||
<inline>
|
||||
wo
|
||||
<anchor />
|
||||
rd
|
||||
</inline>
|
||||
<text />
|
||||
</block>
|
||||
<block>
|
||||
<text />
|
||||
<inline>
|
||||
an
|
||||
<focus />
|
||||
other
|
||||
</inline>
|
||||
<text />
|
||||
</block>
|
||||
</block>
|
||||
</editor>
|
||||
)
|
||||
|
||||
export const output = (
|
||||
<editor>
|
||||
<block>
|
||||
<block>
|
||||
<text />
|
||||
<inline a>
|
||||
<text />
|
||||
<inline>
|
||||
wo
|
||||
<anchor />
|
||||
rd
|
||||
</inline>
|
||||
<text />
|
||||
</inline>
|
||||
<text />
|
||||
</block>
|
||||
<block>
|
||||
<text />
|
||||
<inline a>
|
||||
<text />
|
||||
<inline>
|
||||
an
|
||||
<focus />
|
||||
other
|
||||
</inline>
|
||||
<text />
|
||||
</inline>
|
||||
<text />
|
||||
</block>
|
||||
</block>
|
||||
</editor>
|
||||
)
|
Loading…
x
Reference in New Issue
Block a user