Skip to content
Permalink
Browse files

Make sure attrs are restored when syncing the replace frontier to ran…

…ge end
  • Loading branch information
marijnh committed Mar 18, 2020
1 parent 7d35705 commit b255232081207863a940e0e3f2ded3efa61484ab
Showing with 3 additions and 3 deletions.
  1. +3 −3 src/replace.js
@@ -271,15 +271,15 @@ class Fitter {
if (close.fit.childCount) this.placed = addToFragment(this.placed, close.depth, close.fit)
for (let d = close.depth + 1; d <= $to.depth; d++) {
let node = $to.node(d), add = node.type.contentMatch.fillBefore(node.content, true, $to.index(d))
this.openFrontierNode(node.type, add)
this.openFrontierNode(node.type, node.attrs, add)
}
return true
}

openFrontierNode(type, content) {
openFrontierNode(type, attrs, content) {
let top = this.frontier[this.depth]
top.match = top.match.matchType(type)
this.placed = addToFragment(this.placed, this.depth, Fragment.from(type.create(null, content)))
this.placed = addToFragment(this.placed, this.depth, Fragment.from(type.create(attrs, content)))
this.frontier.push({type, match: type.contentMatch})
}

0 comments on commit b255232

Please sign in to comment.
You can’t perform that action at this time.