Bug 469912

Summary: Excess line breaks in title clips
Product: [Applications] kdenlive Reporter: Gabriel Pinzón <gapc>
Component: Title Clips & SubtitlesAssignee: Jean-Baptiste Mardelle <jb>
Status: REPORTED ---    
Severity: normal CC: kdenlive, ludwig
Priority: NOR    
Version First Reported In: 23.08.4   
Target Milestone: ---   
Platform: Microsoft Windows   
OS: Microsoft Windows   
Latest Commit: Version Fixed/Implemented In:
Sentry Crash Report:
Attachments: Snapshot of how excess line breaks look when editing a title clip

Description Gabriel Pinzón 2023-05-17 22:06:58 UTC
Created attachment 159046 [details]
Snapshot of how excess line breaks look when editing a title clip

Kdenlive adds line breaks to title clips by writing additional &#xd; strings for each line break in each title clip (and also at the end of the lines of "/item", "startviewport rect", "endviewport rect", "background color" and "/kdenlivetitle" as seen when opening the .kdenlive file with a plain text editor) every time a .kdenlive file is saved.


STEPS TO REPRODUCE
1. open an existing .kdenlive file with any amount of title clips
2. modify the .kdenlive file
3. Save the file.
4. Close kdenlive
5. Reopen kdenlive
6. Reopen the same .kdenlive file
7. Right click on a title clip and select "Edit clip".

OBSERVED RESULT
Excess line breaks in title clips caused by &#xd; strings, not visible in the preview or in a processed file, but visible when opening a title clip, additional &#xd; strings visible in a plain text editor.

EXPECTED RESULT
Having only the original line breaks of the file (visible in a plain text editor as mere line breaks on Windows).

SOFTWARE/OS VERSIONS
Windows: 10
KDE Frameworks Version: 5.105.0
Qt Version: 5.15.9

ADDITIONAL INFORMATION
MLT version: 7.15.0
Comment 1 fnx 2023-12-06 13:34:24 UTC
It still occurs in 24.08.3
Comment 3 Linda 2024-09-19 13:24:23 UTC
I am using kdenlive 23.08.5.
My biggest problem with this bug is: in an earlier version, the &#xd; (i.e. carriage return) additions were made whenever the project was saved. Now they are added immediately when the project is opened, so the project is always marked as "modified", even if I changed nothing! It's hard to remember whether I "need" to save the project or not!

Some additional details: It appears to be added to every line of a multi-line property element. This includes the title clips:
<property name="xmldata">&lt;kdenlivetitle ...attributes...>
multiple lines of "nested" xml of the form: &lt; ... >
ending with &lt;/kdenlivetitle>
</property>
Every single line of this multi-line element (except for </property>) is given an additional carriage return, even if it already has one (or more). This behavior becomes "visible" to the user if there are any title clip strings containing multiple lines (for example, when using the typewriter effect by line), since each of these lines is also given an additional carriage return.

The same happens to:
<property name="kdenlive:docproperties.guidesCategories">[
...multiple lines...
]
</property>
But, for comparison, it does not(!) happen to:
<property name="kdenlive:sequenceproperties.groups">[
...multiple lines...
]
</property>
In my project, there are no other lines with multi-line properties (e.g. subtitles, or whatever), but perhaps comparing the source code for the sequenceproperties.groups with the code for the docproperties.guidesCategories can detect the culprit!