wwf
7 小时以前 a1d7e81859f554f3a53680cc35f0f49bf1f77098
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
import { DomEditor, IDomEditor } from '@wangeditor-next/editor'
 
function withProcessRecord<T extends IDomEditor>(editor: T) {
  const { isInline, isVoid } = editor
  const newEditor = editor
 
  newEditor.isInline = (elem) => {
    const type = DomEditor.getNodeType(elem)
    if (type === 'process-record') {
      return true
    }
 
    return isInline(elem)
  }
 
  newEditor.isVoid = (elem) => {
    const type = DomEditor.getNodeType(elem)
    if (type === 'process-record') {
      return true
    }
 
    return isVoid(elem)
  }
 
  return newEditor
}
 
export default withProcessRecord