I think jQuery's behavior is correct here, because the new space will sometimes change the semantics of the document. And it's possible to manually add a space after the target element before removing it, if you want a space, but not possible to manually remove the space if you don't want it.
So, this PR removes the extra space from remove().
In PyQuery,
remove()
currently adds a space in place of the removed element:The same line in jQuery would print
<a>12</a>
.I think jQuery's behavior is correct here, because the new space will sometimes change the semantics of the document. And it's possible to manually add a space after the target element before removing it, if you want a space, but not possible to manually remove the space if you don't want it.
So, this PR removes the extra space from
remove()
.