Fix Issue: #12422 blockreplace adding blank lines

file.blockreplace introduced an unwanted final new line when given
multi-line content due to split() behaviour.
Merge pull request #12522 from creaky/issue12422

Fix Issue: #12422 blockreplace adding blank lines