Bug 513085

Summary: svg text XML nodes with only white space do not get parsed.
Product: [Applications] krita Reporter: wolthera <griffinvalley>
Component: Tool/TextAssignee: wolthera <griffinvalley>
Status: RESOLVED FIXED    
Severity: major CC: alvin
Priority: NOR Keywords: release_blocker
Version First Reported In: git master (please specify the git hash!)   
Target Milestone: ---   
Platform: Other   
OS: Linux   
Latest Commit: Version Fixed/Implemented In:
Sentry Crash Report:
Attachments: Test file with white-space only test content elements.

Description wolthera 2025-12-08 14:53:30 UTC
Created attachment 187426 [details]
Test file with white-space only test content elements.

SUMMARY
This was caused by https://invent.kde.org/graphics/krita/-/commit/153fa48b513b53d773cfbfc3bcb3c125703f8c2c

Qt5.15: https://qt-project.atlassian.net/browse/QTBUG-92369#icft=QTBUG-92369

Qt 6 has https://doc.qt.io/qt-6/qdomdocument.html#ParseOption-enum



STEPS TO REPRODUCE
1. Open test file in krita and firefox.
2. Notice that the second text has overlapping text in krita
3. This is caused by carriage return getting stripped, because it is alone in its text content element.


OBSERVED RESULT

White space only text content elements do not get loaded, leading to removed white spaces.

EXPECTED RESULT

White spaces will get loaded.
Comment 1 wolthera 2025-12-08 14:54:23 UTC
This really needs to be fixed before 5.3, as it'll result in data loss in certain situations.
Comment 2 Bug Janitor Service 2025-12-09 14:13:00 UTC
A possibly relevant merge request was started @ https://invent.kde.org/graphics/krita/-/merge_requests/2562
Comment 3 wolthera 2025-12-17 15:35:13 UTC
Git commit 996609c4a805c52e8fcddf64c7faf34c439aca28 by Wolthera van Hövell, on behalf of Wolthera van Hövell tot Westerflier.
Committed on 17/12/2025 at 15:34.
Pushed by woltherav into branch 'master'.

Reimplement XMLSimpleReader under an ifdef in SVGParser to read white-space only nodes.

M  +42   -1    libs/flake/svg/SvgParser.cpp

https://invent.kde.org/graphics/krita/-/commit/996609c4a805c52e8fcddf64c7faf34c439aca28