Fix crash when replacing \n around empty lines
Summary:
The problem is that QString("").startsWith("") returns false.
Similarly, QString("").endsWith("") also returns false.
However, the code previously was assuming that both cases return true.
This is now fixed, and verified through unit tests.
BUG: 381080
This deprecates patch D6473
Test Plan: make && make test
Reviewers: jsalatas, ltoscano, kfunk, cullmann, anthonyfieroni, mwolff
Reviewed By: cullmann
Subscribers: kwrite-devel, kde-frameworks-devel
Tags: Kate, Frameworks
Differential Revision: https://phabricator.kde.org/D14847