initial commit

This commit is contained in:
Philipp Kühn
2018-08-20 23:02:21 +02:00
parent b37be519d8
commit d111afe7ac
64 changed files with 11545 additions and 0 deletions

12
src/utils/nodeIsActive.js Normal file
View File

@@ -0,0 +1,12 @@
import { findParentNode } from 'prosemirror-utils'
export default function (state, type, attrs) {
const predicate = node => node.type === type
const parent = findParentNode(predicate)(state.selection)
if (attrs === {} || !parent) {
return !!parent
}
return parent.node.hasMarkup(type, attrs)
}