mirror of
https://github.com/ianstormtaylor/slate.git
synced 2025-08-16 20:24:01 +02:00
add test for multiple matching rules
This commit is contained in:
@@ -174,9 +174,7 @@ class Html {
|
|||||||
if (!rule.deserialize) continue
|
if (!rule.deserialize) continue
|
||||||
const ret = rule.deserialize(element, next)
|
const ret = rule.deserialize(element, next)
|
||||||
if (!ret) continue
|
if (!ret) continue
|
||||||
node = ret.kind == 'mark'
|
node = ret.kind == 'mark' ? this.deserializeMark(ret) : ret
|
||||||
? this.deserializeMark(ret)
|
|
||||||
: ret
|
|
||||||
break
|
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: []
|
Reference in New Issue
Block a user