mirror of
https://github.com/ianstormtaylor/slate.git
synced 2025-03-06 05:49:47 +01:00
* Add Prettier, with basic config and ESLint integration * Apply Prettier to all files using `yarn lint --fix` * Tell Prettier to ignore an empty text in a test output. * Run Prettier on JS files not handled by ESLint, and lint them too
27 lines
386 B
JavaScript
27 lines
386 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 == 'image') {
|
|
return React.createElement('img')
|
|
}
|
|
},
|
|
},
|
|
]
|
|
|
|
export const input = (
|
|
<value>
|
|
<document>
|
|
<image />
|
|
</document>
|
|
</value>
|
|
)
|
|
|
|
export const output = `
|
|
<img/>
|
|
`.trim()
|