Fix placement of whitespace when element ends in meta

This was broken for both normal elements, where the meta item is
inside the element, and wrapper paragraphs, where the meta item
gets moved outside the wrapper.

Bug: 47712
Change-Id: I42daaf142e548e5b221ff0a52df0ad24ec6a4fd0
Merge "Fix placement of whitespace when element ends in meta"