fix whitespace handling for mixed paragraph content