1
0
mirror of https://github.com/ianstormtaylor/slate.git synced 2025-03-06 05:49:47 +01:00
Jinxuan Zhu e4ff1972d7 Ensure multi-line expressions are padded by eslint (#1924)
* Fix eslint rule and upgrade eslint

* Fix for switch case

* Linting files
2018-06-21 19:27:10 -07:00

34 lines
599 B
JavaScript

/** @jsx h */
import React from 'react'
import h from '../helpers/h'
export const rules = [
{
serialize(obj, children) {
if (obj.object != 'block') return
switch (obj.type) {
case 'paragraph':
return React.createElement('p', {}, children)
case 'quote':
return React.createElement('blockquote', {}, children)
}
},
},
]
export const input = (
<value>
<document>
<quote>
<paragraph>one</paragraph>
</quote>
</document>
</value>
)
export const output = `
<blockquote><p>one</p></blockquote>
`.trim()