I am using Kate/KWrite on a fresh install of Kubuntu Bionic. I was trying to manually convert a plaintext file to HTML so tried to replace '\n' (without quotes of course) to '<br />\n' but I found that <br /> isn't added to empty lines or lines with pure whitespace (line below ddf in following example has a space) and the last line: BEFORE FIND/REPLACE: sadfasdf asdfas asdfl asdfflsdflasd ddf adflkasf asflkaflkasf AFTER FIND/REPLACE: sadfasdf<br /> asdfas asdfl<br /> asdfflsdflasd<br /> ddf<br /> adflkasf<br /> asflkaflkasf
Sorry for the multiple posts but on closer examination I find the behaviour is much more curious. For an input file such as below (ignore the dashed lines): --- a b --- ... having a newline before the 'a', after the 'b' and between them, only the one between them is recognized. But go to the line after 'b', type one letter and immediately backspace and try the find/replace again, presto the newline after 'b' is recognized, but only once. Try that again and it is no longer recognized! Likewise go to the line before 'a', type one letter and immediately backspace and try the find/replace again, presto the newline before 'a' is recognized. This is very strange to say the least… I should also note that the same behaviour is seen in KDevelop as well presumably because it uses the same Katepart.
This is fixed for KDE Frameworks 5.50, see bug #381080. *** This bug has been marked as a duplicate of bug 381080 ***