Bug 451648 - Markdown: do not remove two trailing spaces aka line break when "remove trailing spaces" is set
Summary: Markdown: do not remove two trailing spaces aka line break when "remove trail...
Status: REOPENED
Alias: None
Product: kate
Classification: Applications
Component: kwrite (show other bugs)
Version: 22.12.3
Platform: Debian stable Linux
: NOR wishlist
Target Milestone: ---
Assignee: KWrite Developers
URL:
Keywords:
: 453319 (view as bug list)
Depends on:
Blocks:
 
Reported: 2022-03-18 09:31 UTC by Konrad Bucheli
Modified: 2023-11-14 14:18 UTC (History)
4 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments
kate settings (97.24 KB, image/png)
2023-11-14 14:16 UTC, werner
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Konrad Bucheli 2022-03-18 09:31:21 UTC
SUMMARY
***
The "remove trailing spaces" option[1] is very useful, except for Markdown files where two space denote a line break. 
Could there be an exception for Markdown files that the two spaces at the end of the line are preserved?
***

[1] https://kate-editor.org/2012/10/27/remove-trailing-spaces/
[2] (https://www.markdownguide.org/basic-syntax/#line-breaks)

SOFTWARE/OS VERSIONS
Kubuntu 21.10
Comment 1 Eric Armbruster 2022-05-03 11:07:31 UTC
*** Bug 453319 has been marked as a duplicate of this bug. ***
Comment 2 Eric Armbruster 2022-05-03 11:09:57 UTC
Can you still reproduce this in 22.04? I think this has been fixed for Markdown files.
Comment 3 Pierre Fernagu--Berthier 2022-05-03 11:24:54 UTC
(In reply to Eric Armbruster from comment #2)
> Can you still reproduce this in 22.04? I think this has been fixed for
> Markdown files.

Yes, I can still reproduce it in 22.04.
Comment 4 Konrad Bucheli 2022-05-04 06:02:03 UTC
(In reply to Pierre Fernagu--Berthier from comment #3)
> (In reply to Eric Armbruster from comment #2)
> > Can you still reproduce this in 22.04? I think this has been fixed for
> > Markdown files.
> 
> Yes, I can still reproduce it in 22.04.

I confirm, it is still reproducible in Ubunut 22.04.
Comment 5 Eric Armbruster 2022-05-04 08:06:40 UTC
Sorry, I meant Kate version 22.04. In Kate go to Help->About Kate to see the Kate version.

Please check again, whether you can reproduce this bug with this version.
Comment 6 Pierre Fernagu--Berthier 2022-05-04 09:26:54 UTC
I have check and I have found the solution. In Settings->Configure Kate, than Open/Save->General and change 'Remove trailing spaces' to never. None the less, thanks for your help.
Comment 7 Eric Armbruster 2022-05-04 09:46:03 UTC
Please leave this bug report open, as the reporter explicitly asks for not removing trailing spaces in Markdown in the case where remove trailing spaces is set until I either get confirmation that this is fixed in 22.04 Kate or I find the fix in the git log.
Comment 8 Konrad Bucheli 2022-05-16 19:00:33 UTC
Luckily on my Manjaro box I got the 22.04.0 version of kate a bit faster than with Kubuntu.
I checked again, but the problem remains: on Markdown documents still all whitespaces at the end of the line are removed when the configuration says it should remove all trailing whitespaces while saving including the double whitespace signaling line break.
Comment 9 werner 2023-11-14 13:44:49 UTC
this bug is still present here with Kate V 22.12.3 (Debian bookworm packages), and, even worse, also when remove trailing spaces upon save is disabled/not set at all - see also https://discuss.kde.org/t/kate-always-strips-spaces-blanks-at-line-end/7177 .
so, kate is just not usable for editing markdown files.
Comment 10 Waqar Ahmed 2023-11-14 13:56:54 UTC
This setting can be changed per file type from settings:

Configure Kate -> Open/Save -> Modes & FileTypes 

Then 
- Select Markdown in Filetype
- In Variables, change 'remove-trailing-spaces' to what you want. There's a button on the far right that helps you do that visually.

This can be preset in KTextEditor for the users.
Comment 11 werner 2023-11-14 14:16:42 UTC
Created attachment 163151 [details]
kate settings
Comment 12 werner 2023-11-14 14:18:16 UTC
thanks for reply, it works now, see attachment before.
I think I had not set file/mime type before.