Ensure clipboard key is removed from paste target

Now that it contains a space, it is not stripped automatically.

Also fix important span check to be recursive.

Bug: T76749
Change-Id: If1c4a764c6b703c63c86a1e0e46cb68d25f83e8a
(cherry picked from commit 5e60f12820bc2a391f50fe1320ab618c11c4dfed)