Now, blockdom keep an array of refs with all the nodes necessary to reach the target refs. But it can be reduced to a smaller number of refs.
The "easy but not optimal" way is to compact chains of single nodes in one. So, if I have <p><p><p><block-text-0/></p></p></p>, we can reuse the previous index to store the next reference when computing them, and end up with an array of either 1 or 2 (depending if we keep el in it) references.
The "optimal" way is to compact all chains of consecutive nodes that are only used by one path into one. This is the same as above, except that it works in a more generic way.
Now, blockdom keep an array of refs with all the nodes necessary to reach the target refs. But it can be reduced to a smaller number of refs.
<p><p><p><block-text-0/></p></p></p>
, we can reuse the previous index to store the next reference when computing them, and end up with an array of either 1 or 2 (depending if we keepel
in it) references.