Just realize that reversing the algorithm won’t work for node.replace(nodes), where nodes contains multiple nodes.
So yeah, replaceWith looks pretty good. > On Jan 12, 2015, at 8:07 PM, Anne van Kesteren <ann...@annevk.nl> wrote: > > On Mon, Jan 12, 2015 at 12:03 PM, Glen Huang <curvedm...@gmail.com> wrote: >> Or, the current algorithm of replace could be reversed, which should >> eliminate such confusion. > > I think as James said that would leave the confusion. And given the > precedent in libraries, replaceWith() seems good. > > > -- > https://annevankesteren.nl/