fix linter errors
This commit is contained in:
@@ -32,8 +32,8 @@ index = $pos.index(d)
|
|||||||
// this is a copy of splitListItem
|
// this is a copy of splitListItem
|
||||||
// see https://github.com/ProseMirror/prosemirror-schema-list/blob/master/src/schema-list.js
|
// see https://github.com/ProseMirror/prosemirror-schema-list/blob/master/src/schema-list.js
|
||||||
|
|
||||||
export default function splitListItem(itemType) {
|
export default function splitToDefaultListItem(itemType) {
|
||||||
return function _splitListItem(state, dispatch) {
|
return function (state, dispatch) {
|
||||||
const { $from, $to, node } = state.selection
|
const { $from, $to, node } = state.selection
|
||||||
if ((node && node.isBlock) || $from.depth < 2 || !$from.sameParent($to)) return false
|
if ((node && node.isBlock) || $from.depth < 2 || !$from.sameParent($to)) return false
|
||||||
const grandParent = $from.node(-1)
|
const grandParent = $from.node(-1)
|
||||||
|
|||||||
@@ -16,9 +16,7 @@ export default class Emitter {
|
|||||||
const callbacks = this._callbacks[event]
|
const callbacks = this._callbacks[event]
|
||||||
|
|
||||||
if (callbacks) {
|
if (callbacks) {
|
||||||
for (const callback of callbacks) {
|
callbacks.forEach(callback => callback.apply(this, args))
|
||||||
callback.apply(this, args)
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return this
|
return this
|
||||||
@@ -46,7 +44,7 @@ export default class Emitter {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// remove specific handler
|
// remove specific handler
|
||||||
for (let i = 0; i < callbacks.length; i++) {
|
for (let i = 0; i < callbacks.length; i += 1) {
|
||||||
const callback = callbacks[i]
|
const callback = callbacks[i]
|
||||||
if (callback === fn) {
|
if (callback === fn) {
|
||||||
callbacks.splice(i, 1)
|
callbacks.splice(i, 1)
|
||||||
|
|||||||
@@ -1,3 +1,3 @@
|
|||||||
export default function (str) {
|
export default function (str) {
|
||||||
return str.replace(/(?:^\w|[A-Z]|\b\w)/g, (word, index) => (index == 0 ? word.toLowerCase() : word.toUpperCase())).replace(/\s+/g, '')
|
return str.replace(/(?:^\w|[A-Z]|\b\w)/g, (word, index) => (index === 0 ? word.toLowerCase() : word.toUpperCase())).replace(/\s+/g, '')
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user