mirror of
https://github.com/ianstormtaylor/slate.git
synced 2025-03-06 13:59:47 +01:00
* rename `kind` to `object` for clarity * add deprecation warning for direct access * add deprecation warning for node creation
30 lines
438 B
JavaScript
30 lines
438 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)
|
|
}
|
|
}
|
|
}
|
|
]
|
|
|
|
export const input = (
|
|
<value>
|
|
<document>
|
|
<paragraph>
|
|
one
|
|
</paragraph>
|
|
</document>
|
|
</value>
|
|
)
|
|
|
|
export const output = `
|
|
<p>one</p>
|
|
`.trim()
|