1
0
mirror of https://github.com/ianstormtaylor/slate.git synced 2025-03-06 13:59:47 +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

34 lines
586 B
JavaScript

/** @jsx h */
import React from 'react'
import h from '../helpers/h'
export const rules = [
{
serialize(obj, children) {
if (obj.object == 'block' && obj.type == 'paragraph') {
return React.createElement('p', {}, children)
}
if (obj.object == 'mark' && obj.type == 'bold') {
return React.createElement('strong', {}, children)
}
}
}
]
export const input = (
<value>
<document>
<paragraph>
on<b>e</b>
</paragraph>
</document>
</value>
)
export const output = `
<p>on<strong>e</strong></p>
`.trim()