Allow merge paragraph to handle unexpected nodes near paragraph boundaries

getTextElements may return some unexpected text nodes if the step filters
haven't correctly identified the first/last step in the paragraph. Rather
than failing completely in this case, simply log the unexpected items and
skip them.

getTextElements itself still needs to be fixed in these cases, but the
harm caused by such mistakes is slightly reduced in this instance.