mirror of
https://github.com/ianstormtaylor/slate.git
synced 2025-07-31 20:40:19 +02:00
add more schema tests
This commit is contained in:
@@ -0,0 +1,30 @@
|
|||||||
|
/** @jsx jsx */
|
||||||
|
|
||||||
|
import { jsx } from 'slate-hyperscript'
|
||||||
|
|
||||||
|
export const schema = [
|
||||||
|
{
|
||||||
|
for: 'node',
|
||||||
|
match: { a: true },
|
||||||
|
validate: {
|
||||||
|
children: [{ match: [{ b: true }, { c: true }] }],
|
||||||
|
},
|
||||||
|
},
|
||||||
|
]
|
||||||
|
|
||||||
|
export const input = (
|
||||||
|
<editor>
|
||||||
|
<element a>
|
||||||
|
<element b>one</element>
|
||||||
|
<element d>two</element>
|
||||||
|
</element>
|
||||||
|
</editor>
|
||||||
|
)
|
||||||
|
|
||||||
|
export const output = (
|
||||||
|
<editor>
|
||||||
|
<element a>
|
||||||
|
<element b>one</element>
|
||||||
|
</element>
|
||||||
|
</editor>
|
||||||
|
)
|
@@ -0,0 +1,24 @@
|
|||||||
|
/** @jsx jsx */
|
||||||
|
|
||||||
|
import { jsx } from 'slate-hyperscript'
|
||||||
|
|
||||||
|
export const schema = [
|
||||||
|
{
|
||||||
|
for: 'node',
|
||||||
|
match: { a: true },
|
||||||
|
validate: {
|
||||||
|
children: [{ match: [{ b: true }, { c: true }] }],
|
||||||
|
},
|
||||||
|
},
|
||||||
|
]
|
||||||
|
|
||||||
|
export const input = (
|
||||||
|
<editor>
|
||||||
|
<element a>
|
||||||
|
<element b>one</element>
|
||||||
|
<element c>two</element>
|
||||||
|
</element>
|
||||||
|
</editor>
|
||||||
|
)
|
||||||
|
|
||||||
|
export const output = input
|
Reference in New Issue
Block a user