1
0
mirror of https://github.com/ianstormtaylor/slate.git synced 2025-04-21 13:51:59 +02:00

add test for multiple matching rules

This commit is contained in:
Ian Storm Taylor 2016-11-17 12:14:01 -08:00
parent fccf7247cf
commit 590b024468
4 changed files with 30 additions and 3 deletions
src/serializers
test/serializers/fixtures/html/deserialize/multiple-matching-rules

@ -174,9 +174,7 @@ class Html {
if (!rule.deserialize) continue
const ret = rule.deserialize(element, next)
if (!ret) continue
node = ret.kind == 'mark'
? this.deserializeMark(ret)
: ret
node = ret.kind == 'mark' ? this.deserializeMark(ret) : ret
break
}

@ -0,0 +1,21 @@
export default {
rules: [
{
deserialize(el, next) {
return {
kind: 'block',
type: 'one'
}
}
},
{
deserialize(el, next) {
return {
kind: 'block',
type: 'two'
}
}
}
]
}

@ -0,0 +1,7 @@
nodes:
- type: one
isVoid: false
data: {}
nodes:
- characters: []