[Kuit] Port QRegExp to QRegularExpression
ClosedPublic

Authored by ahmadsamir on Jan 4 2020, 9:28 AM.

Details

Summary

Port salvageMarkup() to QRegularExpression.

Remove one redundant QRegExp #include.

With this commit all of KI18n has been ported to QRegularExpression.

Test Plan

make && ctest

Diff Detail

Repository
R249 KI18n
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.
ahmadsamir created this revision.Jan 4 2020, 9:28 AM
Restricted Application added a project: Frameworks. · View Herald TranscriptJan 4 2020, 9:28 AM
ahmadsamir requested review of this revision.Jan 4 2020, 9:28 AM
dfaure added a comment.Jan 4 2020, 9:58 AM

Unittest for this method added in https://commits.kde.org/ki18n/a92305a4c15ac361417eeb7b933682960c7545e1
Please check your change passes the test.
Extend as needed if you noticed other cases that need to be handled.

ahmadsamir updated this revision to Diff 72756.Jan 4 2020, 4:05 PM

Rebase after unit test commits

dfaure accepted this revision.Jan 4 2020, 4:59 PM
This revision is now accepted and ready to land.Jan 4 2020, 4:59 PM
This revision was automatically updated to reflect the committed changes.

Unittest for this method added in https://commits.kde.org/ki18n/a92305a4c15ac361417eeb7b933682960c7545e1
Please check your change passes the test.
Extend as needed if you noticed other cases that need to be handled.

I tried to figure out what a "tag without content" in salvageMarkup() would be (to extend the unit test), but couldn't figure it out; <br /> or <hr /> came to mind, but I am not that versed with translation stuff in KDE.

Me neither, but the regexp should tell us what it's about, right? ;)

Indeed it seems to me that this is about things like <br/> but also <unknown/> and even <unknown attr1="value1"/>