mirror of
https://github.com/ueberdosis/tiptap.git
synced 2025-08-06 13:38:49 +08:00
refactoring
This commit is contained in:
parent
888e7a518e
commit
05be43ac54
@ -15,15 +15,17 @@ export default function (doc: Node): DecorationSet {
|
||||
return
|
||||
}
|
||||
|
||||
[...node.text.matchAll(hexColor)].forEach(match => {
|
||||
const index = match.index || 0
|
||||
Array
|
||||
.from(node.text.matchAll(hexColor))
|
||||
.forEach(match => {
|
||||
const index = match.index || 0
|
||||
|
||||
results.push({
|
||||
color: match[0],
|
||||
from: position + index,
|
||||
to: position + index + match[0].length,
|
||||
results.push({
|
||||
color: match[0],
|
||||
from: position + index,
|
||||
to: position + index + match[0].length,
|
||||
})
|
||||
})
|
||||
})
|
||||
})
|
||||
|
||||
results.forEach(issue => {
|
||||
|
Loading…
Reference in New Issue
Block a user