mirror of
https://github.com/ianstormtaylor/slate.git
synced 2025-08-22 15:02:51 +02:00
fix linting
This commit is contained in:
@@ -27,7 +27,7 @@ const defaultBlock = {
|
|||||||
|
|
||||||
const schema = {
|
const schema = {
|
||||||
nodes: {
|
nodes: {
|
||||||
image: props => {
|
image: (props) => {
|
||||||
const { node, state } = props
|
const { node, state } = props
|
||||||
const isFocused = state.selection.hasEdgeIn(node)
|
const isFocused = state.selection.hasEdgeIn(node)
|
||||||
const src = node.data.get('src')
|
const src = node.data.get('src')
|
||||||
@@ -36,17 +36,17 @@ const schema = {
|
|||||||
<img src={src} className={className} {...props.attributes} />
|
<img src={src} className={className} {...props.attributes} />
|
||||||
)
|
)
|
||||||
},
|
},
|
||||||
paragraph: props => {
|
paragraph: (props) => {
|
||||||
return <p {...props.attributes}>{props.children}</p>
|
return <p {...props.attributes}>{props.children}</p>
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
rules: [
|
rules: [
|
||||||
// Rule to insert a paragraph block if the document is empty
|
// Rule to insert a paragraph block if the document is empty
|
||||||
{
|
{
|
||||||
match: node => {
|
match: (node) => {
|
||||||
return node.kind == 'document'
|
return node.kind == 'document'
|
||||||
},
|
},
|
||||||
validate: document => {
|
validate: (document) => {
|
||||||
return document.nodes.size ? null : true
|
return document.nodes.size ? null : true
|
||||||
},
|
},
|
||||||
normalize: (transform, document) => {
|
normalize: (transform, document) => {
|
||||||
@@ -58,10 +58,10 @@ const schema = {
|
|||||||
// Rule to insert a paragraph below a void node (the image)
|
// Rule to insert a paragraph below a void node (the image)
|
||||||
// if that node is the last one in the document
|
// if that node is the last one in the document
|
||||||
{
|
{
|
||||||
match: node => {
|
match: (node) => {
|
||||||
return node.kind == 'document'
|
return node.kind == 'document'
|
||||||
},
|
},
|
||||||
validate: document => {
|
validate: (document) => {
|
||||||
const lastNode = document.nodes.last()
|
const lastNode = document.nodes.last()
|
||||||
return lastNode && lastNode.isVoid ? true : null
|
return lastNode && lastNode.isVoid ? true : null
|
||||||
},
|
},
|
||||||
|
Reference in New Issue
Block a user