Avoid cx-segment spans appearing in published content
Testplan:
Start translating a paragraph. After the source content
is copied to target paragraph, delete the last sentence of
that paragraph using backspace.
Inspect the paragraph and you will see that even though the
content was removed, the wrapper span still exist as empty
span in the paragraph. Now publish. Without this patch,
the published content will have that empty span. With this
patch you should not see the empty span in the published
content.
For unknown reason to me, the replaceWith function with
the cloned content does not remove all .cx-segment spans.
With the above testplan, the empty span.cx-segment did not
get removed. So I am reducing the scope of .find and
.replaceWith to section levels and I see it working.
Bug: T96234
Change-Id: I962c6ae8e6993e597c71a8c283868554fdb546d1