1
0
mirror of https://github.com/ianstormtaylor/slate.git synced 2025-08-22 15:02:51 +02:00

fix linting

This commit is contained in:
Ian Storm Taylor
2017-02-25 12:55:31 -08:00
parent c456c9dbe1
commit 8f92ec6a6d

View File

@@ -27,7 +27,7 @@ const defaultBlock = {
const schema = {
nodes: {
image: props => {
image: (props) => {
const { node, state } = props
const isFocused = state.selection.hasEdgeIn(node)
const src = node.data.get('src')
@@ -36,17 +36,17 @@ const schema = {
<img src={src} className={className} {...props.attributes} />
)
},
paragraph: props => {
paragraph: (props) => {
return <p {...props.attributes}>{props.children}</p>
}
},
rules: [
// Rule to insert a paragraph block if the document is empty
{
match: node => {
match: (node) => {
return node.kind == 'document'
},
validate: document => {
validate: (document) => {
return document.nodes.size ? null : true
},
normalize: (transform, document) => {
@@ -58,10 +58,10 @@ const schema = {
// Rule to insert a paragraph below a void node (the image)
// if that node is the last one in the document
{
match: node => {
match: (node) => {
return node.kind == 'document'
},
validate: document => {
validate: (document) => {
const lastNode = document.nodes.last()
return lastNode && lastNode.isVoid ? true : null
},