This fix closes issue #10642 -- it's not perfect, but should retain most blank lines...