1
0
mirror of https://github.com/ianstormtaylor/slate.git synced 2025-03-10 00:10:18 +01:00
Ian Storm Taylor 5444a300b8
rename kind to object for clarity (#1501)
* rename `kind` to `object` for clarity

* add deprecation warning for direct access

* add deprecation warning for node creation
2018-01-04 15:26:53 -08:00

46 lines
778 B
JavaScript

/** @jsx h */
import h from '../helpers/h'
export const config = {
rules: [
{
deserialize(el, next) {
switch (el.tagName.toLowerCase()) {
case 'p': {
return {
object: 'block',
type: 'paragraph',
nodes: next(el.childNodes),
}
}
case 'blockquote': {
return {
object: 'block',
type: 'quote',
nodes: next(el.childNodes),
}
}
}
}
}
]
}
export const input = `
<blockquote><p>one</p></blockquote>
`.trim()
export const output = (
<value>
<document>
<quote>
<paragraph>
one
</paragraph>
</quote>
</document>
</value>
)