1
0
mirror of https://github.com/ianstormtaylor/slate.git synced 2025-08-31 02:49:56 +02:00

more fixes, before adding components

This commit is contained in:
Ian Storm Taylor
2016-08-13 16:29:15 -07:00
parent 8692d1a98a
commit 1008a2fb14
4 changed files with 1 additions and 7 deletions

View File

@@ -368,7 +368,6 @@ class Editor extends React.Component {
for (const plugin of plugins) {
if (!plugin.schema) continue
debugger
const schema = Schema.create(plugin.schema)
rules = rules.concat(schema.rules)
}

View File

@@ -1106,6 +1106,7 @@ memoize(Node, [
'assertDescendant',
'findDescendant',
'filterDescendants',
'filterDescendantsDeep',
'getBlocks',
'getBlocksAtRange',
'getCharactersAtRange',

View File

@@ -171,9 +171,7 @@ class Schema extends new Record(DEFAULTS) {
const match = this.rules.find((rule) => {
if (!rule.match(object)) return
debugger
if (!rule.validate) return
debugger
reason = rule.validate(object)
return reason
})
@@ -324,11 +322,9 @@ function normalizeSpec(obj, giveReason) {
return (node) => {
for (const key in CHECKS) {
const value = spec[key]
debugger
if (value == null) continue
debugger
const fail = CHECKS[key]
const failure = fail(node, value)

View File

@@ -374,14 +374,12 @@ class State extends new Record(DEFAULTS) {
document.filterDescendantsDeep((node) => {
if (failure = node.validate(schema)) {
const { reason, rule } = failure
debugger
transform = rule.transform(transform, node, reason)
}
})
if (failure = document.validate(schema)) {
const { reason, rule } = failure
debugger
transform = rule.transform(transform, document, reason)
}