I have to work with the messiest HTML where individual words are split into separate tags, like in the following example:
Perhaps you could check if the b.previousSibling is a b tag, then append the inner text from the current node into that. After doing this - you should be able to remove the current node from the tree with b.decompose.
b.previousSibling
b
b.decompose