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:
parent
fccf7247cf
commit
590b024468
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 @@
|
||||
<p></p>
|
@ -0,0 +1,7 @@
|
||||
|
||||
nodes:
|
||||
- type: one
|
||||
isVoid: false
|
||||
data: {}
|
||||
nodes:
|
||||
- characters: []
|
Loading…
x
Reference in New Issue
Block a user