mirror of
https://github.com/ianstormtaylor/slate.git
synced 2025-03-10 00:10:18 +01:00
* rename state to value in slate core, as deprecation * rename all references to state to value in slate core * migrate slate-base64-serializer * migrate slate-html-serializer * migrate slate-hyperscript * migrate slate-plain-serializer * migrate slate-prop-types * migrate slate-simulator * fix change.setState compat * deprecate references to state in slate-react * remove all references to state in slate-react * remove `value` and `schema` from props to all components * fix default renderPlaceholder * fix tests * update examples * update walkthroughs * update guides * update reference
46 lines
774 B
JavaScript
46 lines
774 B
JavaScript
|
|
/** @jsx h */
|
|
|
|
import h from '../helpers/h'
|
|
|
|
export const config = {
|
|
rules: [
|
|
{
|
|
deserialize(el, next) {
|
|
switch (el.tagName.toLowerCase()) {
|
|
case 'p': {
|
|
return {
|
|
kind: 'block',
|
|
type: 'paragraph',
|
|
nodes: next(el.childNodes),
|
|
}
|
|
}
|
|
case 'blockquote': {
|
|
return {
|
|
kind: '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>
|
|
)
|