Hello community, here is the log from the commit of package kpimtextedit for openSUSE:Factory checked in at 2020-07-14 07:49:32 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/kpimtextedit (Old) and /work/SRC/openSUSE:Factory/.kpimtextedit.new.3060 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "kpimtextedit" Tue Jul 14 07:49:32 2020 rev:61 rq:820245 version:20.04.3 Changes: -------- --- /work/SRC/openSUSE:Factory/kpimtextedit/kpimtextedit.changes 2020-06-14 18:22:15.984023114 +0200 +++ /work/SRC/openSUSE:Factory/.kpimtextedit.new.3060/kpimtextedit.changes 2020-07-14 07:49:47.703945569 +0200 @@ -1,0 +2,13 @@ +Thu Jul 9 20:10:13 UTC 2020 - Luca Beltrame <[email protected]> + +- Update to 20.04.3 + * New bugfix release + * For more details please see: + * https://kde.org/announcements/releases/2020-07-apps-update +- Changes since 20.04.2: + * Add autotest for bug found by David + * Fix generate html text (bug found by david) + * Fix mem leak + * Add more autotests + +------------------------------------------------------------------- Old: ---- kpimtextedit-20.04.2.tar.xz kpimtextedit-20.04.2.tar.xz.sig New: ---- kpimtextedit-20.04.3.tar.xz kpimtextedit-20.04.3.tar.xz.sig ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ kpimtextedit.spec ++++++ --- /var/tmp/diff_new_pack.rziiQF/_old 2020-07-14 07:49:48.255947351 +0200 +++ /var/tmp/diff_new_pack.rziiQF/_new 2020-07-14 07:49:48.255947351 +0200 @@ -21,7 +21,7 @@ %{!?_kapp_version: %define _kapp_version %(echo %{version}| awk -F. '{print $1"."$2}')} %bcond_without lang Name: kpimtextedit -Version: 20.04.2 +Version: 20.04.3 Release: 0 Summary: KDE PIM Libraries: Text edit functionality License: LGPL-2.1-or-later ++++++ kpimtextedit-20.04.2.tar.xz -> kpimtextedit-20.04.3.tar.xz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kpimtextedit-20.04.2/CMakeLists.txt new/kpimtextedit-20.04.3/CMakeLists.txt --- old/kpimtextedit-20.04.2/CMakeLists.txt 2020-06-09 02:44:30.000000000 +0200 +++ new/kpimtextedit-20.04.3/CMakeLists.txt 2020-07-07 03:07:13.000000000 +0200 @@ -1,5 +1,5 @@ cmake_minimum_required(VERSION 3.5) -set(PIM_VERSION "5.14.2") +set(PIM_VERSION "5.14.3") project(KPimTextEdit VERSION ${PIM_VERSION}) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kpimtextedit-20.04.2/po/sr/libkpimtextedit.po new/kpimtextedit-20.04.3/po/sr/libkpimtextedit.po --- old/kpimtextedit-20.04.2/po/sr/libkpimtextedit.po 2020-06-09 02:44:29.000000000 +0200 +++ new/kpimtextedit-20.04.3/po/sr/libkpimtextedit.po 2020-07-07 03:07:13.000000000 +0200 @@ -3,8 +3,8 @@ msgid "" msgstr "" "Project-Id-Version: libkpimtextedit\n" -"Report-Msgid-Bugs-To: http://bugs.kde.org\n" -"POT-Creation-Date: 2019-03-30 03:33+0100\n" +"Report-Msgid-Bugs-To: https://bugs.kde.org\n" +"POT-Creation-Date: 2019-12-21 03:35+0100\n" "PO-Revision-Date: 2017-12-24 21:47+0100\n" "Last-Translator: Chusslove Illich <[email protected]>\n" "Language-Team: Serbian <[email protected]>\n" @@ -20,7 +20,9 @@ # >> @title:window #: composer-ng/klinkdialog.cpp:38 -#, kde-format +#, fuzzy, kde-format +#| msgid "Manage Link" +msgctxt "@title:window" msgid "Manage Link" msgstr "Управљање везом" @@ -279,7 +281,7 @@ # >! @action # >! @title:window -#: composer-ng/richtextcomposeractions.cpp:405 insertimagewidget.cpp:65 +#: composer-ng/richtextcomposeractions.cpp:405 #, kde-format msgid "Add Image" msgstr "Додај слику" @@ -317,12 +319,12 @@ msgstr "Пресликавач формата" # rewrite-msgid: /email/message/ -#: composer-ng/richtextcomposercontroler.cpp:616 +#: composer-ng/richtextcomposercontroler.cpp:615 #, kde-format msgid "I've linked 1 file to this email:" msgstr "Један фајл повезан са овом поруком:" -#: composer-ng/richtextcomposercontroler.cpp:732 +#: composer-ng/richtextcomposercontroler.cpp:731 #, kde-format msgid "Only local files are supported." msgstr "Подржани су само локални фајлови." @@ -333,7 +335,7 @@ msgid "Unable to load image <filename>%1</filename>." msgstr "Не могу да учитам слику <filename>%1</filename>." -#: composer-ng/richtextcomposerimages.cpp:234 +#: composer-ng/richtextcomposerimages.cpp:240 #, kde-format msgctxt "Start of the filename for an image" msgid "image" @@ -399,52 +401,173 @@ msgid "Add Smiley" msgstr "Додај смешак" -#: emoticon/emoticonunicodetab.cpp:40 +#: emoticon/emoticonunicodetab.cpp:44 #, kde-format msgid "Faces" msgstr "" -#: emoticon/emoticonunicodetab.cpp:41 +#: emoticon/emoticonunicodetab.cpp:45 #, kde-format msgid "Animals" msgstr "" -#: emoticon/emoticonunicodetab.cpp:42 +#: emoticon/emoticonunicodetab.cpp:46 #, fuzzy, kde-format #| msgid "Options" msgid "Emotions" msgstr "Опције" -#: emoticon/emoticonunicodetab.cpp:43 +#: emoticon/emoticonunicodetab.cpp:47 #, kde-format msgid "Body" msgstr "" -#: emoticon/emoticonunicodetab.cpp:44 +#: emoticon/emoticonunicodetab.cpp:48 #, kde-format msgid "Transports" msgstr "" -#: emoticon/emoticonunicodetab.cpp:45 +#: emoticon/emoticonunicodetab.cpp:49 #, kde-format msgid "Events" msgstr "" -#: emoticon/emoticonunicodetab.cpp:46 +#: emoticon/emoticonunicodetab.cpp:50 #, kde-format msgid "Flags" msgstr "" -#: emoticon/emoticonunicodetab.cpp:47 +#: emoticon/emoticonunicodetab.cpp:51 #, kde-format msgid "Weather" msgstr "" -#: emoticon/emoticonunicodetab.cpp:48 +#: emoticon/emoticonunicodetab.cpp:52 #, kde-format msgid "Foods" msgstr "" +#: emoticon/emoticonunicodetab.cpp:53 +#, kde-format +msgid "Sports" +msgstr "" + +#: emoticon/emoticonunicodetab.cpp:54 +#, kde-format +msgid "Time" +msgstr "" + +#: emoticon/emoticonunicodetab.cpp:55 +#, kde-format +msgid "Game" +msgstr "" + +#: emoticon/emoticonunicodetab.cpp:56 +#, kde-format +msgid "Clothing" +msgstr "" + +#: emoticon/emoticonunicodetab.cpp:57 +#, kde-format +msgid "Music" +msgstr "" + +#: emoticon/emoticonunicodetab.cpp:58 +#, kde-format +msgid "Computer" +msgstr "" + +#: emoticon/emoticonunicodetab.cpp:59 +#, kde-format +msgid "Symbols" +msgstr "" + +#: emoticon/emoticonunicodetab.cpp:60 +#, kde-format +msgid "Plant" +msgstr "" + +#: emoticon/emoticonunicodetab.cpp:61 +#, kde-format +msgid "Book" +msgstr "" + +#: emoticon/emoticonunicodetab.cpp:62 +#, kde-format +msgid "Science" +msgstr "" + +#: emoticon/emoticonunicodetab.cpp:63 +#, kde-format +msgid "Person" +msgstr "" + +#: emoticon/emoticonunicodetab.cpp:64 +#, fuzzy, kde-format +#| msgid "Replace" +msgid "Place" +msgstr "Замени" + +#: emoticon/emoticonunicodetab.cpp:65 +#, kde-format +msgid "Money" +msgstr "" + +#: emoticon/emoticonunicodetab.cpp:66 +#, kde-format +msgid "Mail" +msgstr "" + +#: emoticon/emoticonunicodetab.cpp:67 +#, kde-format +msgid "Office" +msgstr "" + +#: emoticon/emoticonunicodetab.cpp:68 +#, kde-format +msgid "Tools" +msgstr "" + +#: emoticon/emoticonunicodetab.cpp:69 +#, kde-format +msgid "Phone" +msgstr "" + +#: emoticon/emoticonunicodetab.cpp:70 +#, kde-format +msgid "Lock" +msgstr "" + +#: emoticon/emoticonunicodetab.cpp:71 +#, kde-format +msgid "Drink" +msgstr "" + +#: emoticon/emoticonunicodetab.cpp:72 +#, kde-format +msgid "Video" +msgstr "" + +#: emoticon/emoticonunicodetab.cpp:73 +#, kde-format +msgid "House" +msgstr "" + +#: emoticon/emoticonunicodetab.cpp:74 +#, kde-format +msgid "Dishware" +msgstr "" + +#: emoticon/emoticonunicodetab.cpp:75 +#, kde-format +msgid "Hotel" +msgstr "" + +#: emoticon/emoticonunicodetab.cpp:76 +#, kde-format +msgid "Award-Medal" +msgstr "" + #: inserthtmldialog.cpp:39 #, kde-format msgctxt "@title:window" @@ -469,12 +592,14 @@ # >> @title:window #: insertimagedialog.cpp:39 -#, kde-format +#, fuzzy, kde-format +#| msgid "Insert Image" +msgctxt "@title:window" msgid "Insert Image" msgstr "Уметање слике" #: insertimagedialog.cpp:48 inserttabledialog.cpp:50 -#: selectspecialchardialog.cpp:45 tableactionmenu.cpp:423 +#: selectspecialchardialog.cpp:47 tableactionmenu.cpp:423 #, kde-format msgid "Insert" msgstr "Уметни" @@ -484,6 +609,15 @@ msgid "Image Location:" msgstr "Локација слике:" +# >! @action +# >! @title:window +#: insertimagewidget.cpp:65 +#, fuzzy, kde-format +#| msgid "Add Image" +msgctxt "@title:window" +msgid "Add Image" +msgstr "Додај слику" + #: insertimagewidget.cpp:77 #, kde-format msgid "Keep Original Size" @@ -517,7 +651,9 @@ # >> @title:window #: inserttabledialog.cpp:39 -#, kde-format +#, fuzzy, kde-format +#| msgid "Insert Table" +msgctxt "@title:window" msgid "Insert Table" msgstr "Уметање табеле" @@ -547,12 +683,14 @@ msgstr "пиксела" # >> @title:window -#: selectspecialchardialog.cpp:34 -#, kde-format +#: selectspecialchardialog.cpp:36 +#, fuzzy, kde-format +#| msgid "Select Special Characters" +msgctxt "@title:window" msgid "Select Special Characters" msgstr "Избор посебних знакова" -#: selectspecialchardialog.cpp:58 +#: selectspecialchardialog.cpp:60 #, kde-format msgid "Select" msgstr "Изабери" @@ -619,7 +757,9 @@ msgstr "Формат ћелије..." #: tablecellformatdialog.cpp:41 -#, kde-format +#, fuzzy, kde-format +#| msgid "Cell Format" +msgctxt "@title:window" msgid "Cell Format" msgstr "Формат ћелије" @@ -649,7 +789,9 @@ msgstr "Боја позадине:" #: tableformatdialog.cpp:44 -#, kde-format +#, fuzzy, kde-format +#| msgid "Table Format" +msgctxt "@title:window" msgid "Table Format" msgstr "Формат табеле" @@ -702,8 +844,8 @@ msgid "Table Alignment:" msgstr "Поравнање табеле:" -#: texteditor/commonwidget/texteditfindbarbase.cpp:49 -#: texteditor/commonwidget/texteditfindbarbase.cpp:52 +#: texteditor/commonwidget/texteditfindbarbase.cpp:47 +#: texteditor/commonwidget/texteditfindbarbase.cpp:50 #: texteditor/commonwidget/textgotolinewidget.cpp:54 #: texteditor/commonwidget/textgotolinewidget.cpp:57 #: texttospeech/texttospeechwidget.cpp:62 @@ -711,7 +853,7 @@ msgid "Close" msgstr "Затвори" -#: texteditor/commonwidget/texteditfindbarbase.cpp:159 +#: texteditor/commonwidget/texteditfindbarbase.cpp:157 #, kde-format msgid "" "End of message reached.\n" @@ -805,54 +947,54 @@ msgid "Go" msgstr "Иди" -#: texteditor/plaintexteditor/plaintexteditor.cpp:153 -#: texteditor/richtexteditor/richtexteditor.cpp:186 +#: texteditor/plaintexteditor/plaintexteditor.cpp:149 +#: texteditor/richtexteditor/richtexteditor.cpp:182 #, kde-format msgid "Replace..." msgstr "Замени..." -#: texteditor/plaintexteditor/plaintexteditor.cpp:167 -#: texteditor/richtexteditor/richtexteditor.cpp:201 +#: texteditor/plaintexteditor/plaintexteditor.cpp:163 +#: texteditor/richtexteditor/richtexteditor.cpp:197 #, kde-format msgid "Check Spelling..." msgstr "Провери правопис..." -#: texteditor/plaintexteditor/plaintexteditor.cpp:170 -#: texteditor/richtexteditor/richtexteditor.cpp:206 +#: texteditor/plaintexteditor/plaintexteditor.cpp:166 +#: texteditor/richtexteditor/richtexteditor.cpp:202 #, kde-format msgid "Auto Spell Check" msgstr "Аутоматска провера правописа" -#: texteditor/plaintexteditor/plaintexteditor.cpp:176 -#: texteditor/richtexteditor/richtexteditor.cpp:212 +#: texteditor/plaintexteditor/plaintexteditor.cpp:172 +#: texteditor/richtexteditor/richtexteditor.cpp:208 #, kde-format msgid "Spell Checking Language" msgstr "Језик провере правописа" -#: texteditor/plaintexteditor/plaintexteditor.cpp:204 -#: texteditor/richtexteditor/richtexteditor.cpp:246 +#: texteditor/plaintexteditor/plaintexteditor.cpp:200 +#: texteditor/richtexteditor/richtexteditor.cpp:242 #, kde-format msgid "Speak Text" msgstr "Изговори текст" -#: texteditor/plaintexteditor/plaintexteditor.cpp:345 -#: texteditor/richtexteditor/richtexteditor.cpp:424 +#: texteditor/plaintexteditor/plaintexteditor.cpp:341 +#: texteditor/richtexteditor/richtexteditor.cpp:420 #, kde-format msgid "Nothing to spell check." msgstr "Нема ничег за проверу правописа." -#: texteditor/plaintexteditor/plaintexteditor.cpp:350 -#: texteditor/richtexteditor/richtexteditor.cpp:437 +#: texteditor/plaintexteditor/plaintexteditor.cpp:346 +#: texteditor/richtexteditor/richtexteditor.cpp:433 #, kde-format msgid "No backend available for spell checking." msgstr "Нема позадине за проверу правописа." -#: texteditor/richtexteditor/richtexteditor.cpp:238 +#: texteditor/richtexteditor/richtexteditor.cpp:234 #, kde-format msgid "Allow Tabulations" msgstr "Дозволи табулације" -#: texteditor/richtexteditor/richtexteditor.cpp:433 +#: texteditor/richtexteditor/richtexteditor.cpp:429 #, fuzzy, kde-format #| msgid "No backend available for spell checking." msgid "" @@ -860,7 +1002,7 @@ "anyways?" msgstr "Нема позадине за проверу правописа." -#: texteditor/richtexteditor/richtexteditor.cpp:453 +#: texteditor/richtexteditor/richtexteditor.cpp:449 #, kde-format msgid "Skip" msgstr "Прескочи" @@ -883,7 +1025,9 @@ # >> @title:window #: texttospeech/texttospeechconfigdialog.cpp:35 -#, kde-format +#, fuzzy, kde-format +#| msgid "Configure Text-To-Speech" +msgctxt "@title:window" msgid "Configure Text-To-Speech" msgstr "Подешавање текста‑у‑говор" diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kpimtextedit-20.04.2/po/zh_CN/libkpimtextedit.po new/kpimtextedit-20.04.3/po/zh_CN/libkpimtextedit.po --- old/kpimtextedit-20.04.2/po/zh_CN/libkpimtextedit.po 2020-06-09 02:44:30.000000000 +0200 +++ new/kpimtextedit-20.04.3/po/zh_CN/libkpimtextedit.po 2020-07-07 03:07:13.000000000 +0200 @@ -9,8 +9,8 @@ "Project-Id-Version: kdeorg\n" "Report-Msgid-Bugs-To: https://bugs.kde.org\n" "POT-Creation-Date: 2019-12-21 03:35+0100\n" -"PO-Revision-Date: 2020-05-09 13:51\n" -"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" +"PO-Revision-Date: 2020-06-24 08:01\n" +"Last-Translator: \n" "Language-Team: Chinese Simplified\n" "Language: zh_CN\n" "MIME-Version: 1.0\n" @@ -18,8 +18,10 @@ "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=1; plural=0;\n" "X-Crowdin-Project: kdeorg\n" +"X-Crowdin-Project-ID: 269464\n" "X-Crowdin-Language: zh-CN\n" -"X-Crowdin-File: /kf5-stable/messages/pim/libkpimtextedit.pot\n" +"X-Crowdin-File: /kf5-stable/messages/kpimtextedit/libkpimtextedit.pot\n" +"X-Crowdin-File-ID: 3210\n" #: composer-ng/klinkdialog.cpp:38 #, kde-format diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kpimtextedit-20.04.2/src/grantleebuilder/autotests/plaintextmarkupbuildertest.cpp new/kpimtextedit-20.04.3/src/grantleebuilder/autotests/plaintextmarkupbuildertest.cpp --- old/kpimtextedit-20.04.2/src/grantleebuilder/autotests/plaintextmarkupbuildertest.cpp 2020-05-23 17:45:33.000000000 +0200 +++ new/kpimtextedit-20.04.3/src/grantleebuilder/autotests/plaintextmarkupbuildertest.cpp 2020-07-02 06:54:50.000000000 +0200 @@ -47,7 +47,7 @@ //FIXME bug is about id="..." QTest::newRow("bug345360") << QStringLiteral("<html><body><center><table><tr><td><div id=\"foo\"><span> Dear User, </span> <br> <br> <span> We have updated our Privacy Policy and Terms of Service. Please take a few minutes to read and understand them. To help you understand, we have summarized the changes and provided a comparison of the current and the previous versions. </span> <br> <br> <span> These changes will take effect on April 19, 2015. If you continue to use Zoho after April 19, 2015, you will be governed by the new Privacy Policy and Terms of Service. </span> <br> <br> <span> ddd </span></td></tr></table></center></body></html>") - << QStringLiteral("foo"); + << QStringLiteral("foo"); } void PlainTextMarkupBuilderTest::testPlainText() @@ -73,4 +73,724 @@ delete md; delete hb; delete doc; +} + +void PlainTextMarkupBuilderTest::testSingleFormat() +{ + auto doc = new QTextDocument(); + + // One format + doc->setHtml(QStringLiteral("This <b>text</b> is bold.")); + + auto hb = new KPIMTextEdit::PlainTextMarkupBuilder(); + auto md = new KPIMTextEdit::MarkupDirector(hb); + md->processDocument(doc); + auto result = hb->getResult(); + QRegularExpression regex(QStringLiteral("^This \\*text\\* is bold.\\n$")); + + QVERIFY(regex.match(result).hasMatch()); + delete md; + delete hb; + delete doc; + +} + +void PlainTextMarkupBuilderTest::testDoubleFormat() +{ + auto doc = new QTextDocument(); + + // One format + doc->setHtml(QStringLiteral("Some <b><i>formatted</i></b> text.")); + + auto hb = new KPIMTextEdit::PlainTextMarkupBuilder(); + auto md = new KPIMTextEdit::MarkupDirector(hb); + md->processDocument(doc); + auto result = hb->getResult(); + QRegularExpression regex( + QStringLiteral("^Some (\\*/|/\\*)formatted(\\*/|/\\*) text.\\n$")); + + QVERIFY(regex.match(result).hasMatch()); + delete md; + delete hb; + delete doc; + +} + +void PlainTextMarkupBuilderTest::testAnchor() +{ + auto doc = new QTextDocument(); + doc->setHtml( + QStringLiteral("A <a href=\"http://www.kde.org\">link</a> to KDE.")); + + auto hb = new KPIMTextEdit::PlainTextMarkupBuilder(); + auto md = new KPIMTextEdit::MarkupDirector(hb); + md->processDocument(doc); + auto result = hb->getResult(); + + QRegularExpression regex(QStringLiteral( + "^A link\\[1\\] to KDE.\\n\\n--------\\n\\[1\\] http://www.kde.org\\n$")); + + regex.match(result).hasMatch(); + + QVERIFY(regex.match(result).hasMatch()); + delete md; + delete hb; + delete doc; + +} + +void PlainTextMarkupBuilderTest::testAnchorWithFormattedContent() +{ + auto doc = new QTextDocument(); + doc->setHtml(QStringLiteral( + "A <a href=\"http://www.kde.org\"><b>formatted</b> link</a> to KDE.")); + + auto hb = new KPIMTextEdit::PlainTextMarkupBuilder(); + auto md = new KPIMTextEdit::MarkupDirector(hb); + md->processDocument(doc); + auto result = hb->getResult(); + + QRegularExpression regex( + QStringLiteral("^A \\*formatted\\* link\\[1\\] to " + "KDE.\\n\\n--------\\n\\[1\\] http://www.kde.org\\n$")); + + QVERIFY(regex.match(result).hasMatch()); + delete md; + delete hb; + delete doc; + +} + +void PlainTextMarkupBuilderTest::testAdjacentAnchors() +{ + auto doc = new QTextDocument(); + doc->setHtml( + QStringLiteral("Two <a href=\"http://www.kde.org\">links</a><a " + "href=\"http://www.google.com\">next</a> to eachother.")); + + auto hb = new KPIMTextEdit::PlainTextMarkupBuilder(); + auto md = new KPIMTextEdit::MarkupDirector(hb); + md->processDocument(doc); + auto result = hb->getResult(); + + QRegularExpression regex(QStringLiteral( + "^Two links\\[1\\]next\\[2\\] to eachother.\\n\\n--------\\n\\[1\\] " + "http://www.kde.org\\n\\[2\\] http://www.google.com\\n$")); + + QVERIFY(regex.match(result).hasMatch()); + delete md; + delete hb; + delete doc; + +} + +void PlainTextMarkupBuilderTest::testNestedFormatting() +{ + auto doc = new QTextDocument(); + doc->setHtml(QStringLiteral("This <b>text is <i>italic</i> and</b> bold.")); + + auto hb = new KPIMTextEdit::PlainTextMarkupBuilder(); + auto md = new KPIMTextEdit::MarkupDirector(hb); + md->processDocument(doc); + auto result = hb->getResult(); + + QRegularExpression regex( + QStringLiteral("^This \\*text is /italic/ and\\* bold.\\n$")); + + QVERIFY(regex.match(result).hasMatch()); + delete md; + delete hb; + delete doc; + +} + +void PlainTextMarkupBuilderTest::testSpan() +{ + auto doc = new QTextDocument(); + doc->setHtml(QStringLiteral( + "Some <span style=\"color:#ff0000;\">formatted</span> text.")); + + auto hb = new KPIMTextEdit::PlainTextMarkupBuilder(); + auto md = new KPIMTextEdit::MarkupDirector(hb); + md->processDocument(doc); + auto result = hb->getResult(); + + auto regex = QRegularExpression(QStringLiteral("^Some formatted text.\\n$")); + + QVERIFY(regex.match(result).hasMatch()); + delete md; + delete hb; + delete doc; + +} + +void PlainTextMarkupBuilderTest::testDoubleSpan() +{ + auto doc = new QTextDocument(); + doc->setHtml(QStringLiteral("Some <span " + "style=\"color:#ff0000;background-color:#00ff00;" + "\">formatted</span> text.")); + + auto hb = new KPIMTextEdit::PlainTextMarkupBuilder(); + auto md = new KPIMTextEdit::MarkupDirector(hb); + md->processDocument(doc); + auto result = hb->getResult(); + + auto regex = QRegularExpression(QStringLiteral("^Some formatted text.\\n$")); + + QVERIFY(regex.match(result).hasMatch()); + delete md; + delete hb; + delete doc; + +} + +void PlainTextMarkupBuilderTest::testSpanNesting() +{ + auto doc = new QTextDocument(); + doc->setHtml(QStringLiteral( + "Paragraph <span style=\"background-color:#00ff00;\">with some <span " + "style=\"color:#ff0000;\">formatted</span> nested</span> text.")); + + auto hb = new KPIMTextEdit::PlainTextMarkupBuilder(); + auto md = new KPIMTextEdit::MarkupDirector(hb); + md->processDocument(doc); + auto result = hb->getResult(); + + auto regex = QRegularExpression( + QStringLiteral("^Paragraph with some formatted nested text.\\n$")); + + QVERIFY(regex.match(result).hasMatch()); + delete md; + delete hb; + delete doc; + +} + +void PlainTextMarkupBuilderTest::testDoubleStartDifferentFinish() +{ + auto doc = new QTextDocument(); + doc->setHtml( + QStringLiteral("Paragraph <i><b>with</b> some formatted</i> text.")); + + auto hb = new KPIMTextEdit::PlainTextMarkupBuilder(); + auto md = new KPIMTextEdit::MarkupDirector(hb); + md->processDocument(doc); + auto result = hb->getResult(); + + auto regex = QRegularExpression( + QStringLiteral("^Paragraph /\\*with\\* some formatted/ text.\\n$")); + + QVERIFY(regex.match(result).hasMatch()); + delete md; + delete hb; + delete doc; + +} + +void PlainTextMarkupBuilderTest::testDoubleStartDifferentFinishReverseOrder() +{ + auto doc = new QTextDocument(); + doc->setHtml( + QStringLiteral("Paragraph <b><i>with</i> some formatted</b> text.")); + + auto hb = new KPIMTextEdit::PlainTextMarkupBuilder(); + auto md = new KPIMTextEdit::MarkupDirector(hb); + md->processDocument(doc); + auto result = hb->getResult(); + + auto regex = QRegularExpression( + QStringLiteral("^Paragraph \\*/with/ some formatted\\* text.\\n$")); + + QVERIFY(regex.match(result).hasMatch()); + delete md; + delete hb; + delete doc; + +} + +void PlainTextMarkupBuilderTest::testDifferentStartDoubleFinish() +{ + auto doc = new QTextDocument(); + doc->setHtml( + QStringLiteral("Paragraph <i>with some <b>formatted<b></i> text.")); + + auto hb = new KPIMTextEdit::PlainTextMarkupBuilder(); + auto md = new KPIMTextEdit::MarkupDirector(hb); + md->processDocument(doc); + auto result = hb->getResult(); + + auto regex = QRegularExpression( + QStringLiteral("^Paragraph /with some \\*formatted\\*/ text.\\n$")); + + QVERIFY(regex.match(result).hasMatch()); + delete md; + delete hb; + delete doc; + +} + +void PlainTextMarkupBuilderTest::testDifferentStartDoubleFinishReverseOrder() +{ + auto doc = new QTextDocument(); + doc->setHtml( + QStringLiteral("Paragraph <b>with some <i>formatted</i></b> text.")); + + auto hb = new KPIMTextEdit::PlainTextMarkupBuilder(); + auto md = new KPIMTextEdit::MarkupDirector(hb); + md->processDocument(doc); + auto result = hb->getResult(); + + auto regex = QRegularExpression( + QStringLiteral("^Paragraph \\*with some /formatted/\\* text.\\n$")); + + QVERIFY(regex.match(result).hasMatch()); + delete md; + delete hb; + delete doc; + +} + +void PlainTextMarkupBuilderTest::testOverlap() +{ + auto doc = new QTextDocument(); + doc->setHtml(QStringLiteral( + "Paragraph <b>with <i>some</i></b><i> formatted</i> text.")); + + auto hb = new KPIMTextEdit::PlainTextMarkupBuilder(); + auto md = new KPIMTextEdit::MarkupDirector(hb); + md->processDocument(doc); + auto result = hb->getResult(); + + auto regex = QRegularExpression( + QStringLiteral("^Paragraph \\*with /some/\\*/ formatted/ text.\\n$")); + + QVERIFY(regex.match(result).hasMatch()); + delete md; + delete hb; + delete doc; + +} + +void PlainTextMarkupBuilderTest::testEdgeCaseLeft() +{ + auto doc = new QTextDocument(); + doc->setHtml(QStringLiteral("Paragraph <b>with some formatted text.</b>")); + + auto hb = new KPIMTextEdit::PlainTextMarkupBuilder(); + auto md = new KPIMTextEdit::MarkupDirector(hb); + md->processDocument(doc); + auto result = hb->getResult(); + + auto regex = QRegularExpression( + QStringLiteral("^Paragraph \\*with some formatted text.\\*\\n$")); + + QVERIFY(regex.match(result).hasMatch()); + delete md; + delete hb; + delete doc; + +} + +void PlainTextMarkupBuilderTest::testEdgeCaseRight() +{ + auto doc = new QTextDocument(); + doc->setHtml(QStringLiteral("<b>Paragraph with some formatted</b> text.")); + + auto hb = new KPIMTextEdit::PlainTextMarkupBuilder(); + auto md = new KPIMTextEdit::MarkupDirector(hb); + md->processDocument(doc); + auto result = hb->getResult(); + + auto regex = QRegularExpression( + QStringLiteral("^\\*Paragraph with some formatted\\* text.\\n$")); + + QVERIFY(regex.match(result).hasMatch()); + delete md; + delete hb; + delete doc; + +} + +void PlainTextMarkupBuilderTest::testImage() +{ + auto doc = new QTextDocument(); + doc->setHtml( + QStringLiteral("Paragraph with an inline <img " + "src=\"http://kde.org/img/kde41.png\" /> image.")); + + auto hb = new KPIMTextEdit::PlainTextMarkupBuilder(); + auto md = new KPIMTextEdit::MarkupDirector(hb); + md->processDocument(doc); + auto result = hb->getResult(); + + auto regex = QRegularExpression(QStringLiteral( + "^Paragraph with an inline \\[1\\] image.\\n\\n--------\\n\\[1\\] " + "http://kde.org/img/kde41.png\\n$")); + + QVERIFY(regex.match(result).hasMatch()); + delete md; + delete hb; + delete doc; + +} + +void PlainTextMarkupBuilderTest::testImageResized() +{ + QString result; + QRegularExpression regex; + KPIMTextEdit::PlainTextMarkupBuilder *hb; + KPIMTextEdit::MarkupDirector *md; + auto doc = new QTextDocument(); + + // width + doc->setHtml(QStringLiteral( + "Paragraph with an inline <img src=\"http://kde.org/img/kde41.png\" " + "width=\"10\" /> image.")); + + hb = new KPIMTextEdit::PlainTextMarkupBuilder(); + md = new KPIMTextEdit::MarkupDirector(hb); + md->processDocument(doc); + result = hb->getResult(); + + regex = QRegularExpression(QStringLiteral( + "^Paragraph with an inline \\[1\\] image.\\n\\n--------\\n\\[1\\] " + "http://kde.org/img/kde41.png\\n$")); + QVERIFY(regex.match(result).hasMatch()); + + // height + doc->setHtml(QStringLiteral( + "Paragraph with an inline <img src=\"http://kde.org/img/kde41.png\" " + "height=\"10\" /> image.")); + + delete md; + delete hb; + + hb = new KPIMTextEdit::PlainTextMarkupBuilder(); + md = new KPIMTextEdit::MarkupDirector(hb); + md->processDocument(doc); + result = hb->getResult(); + + regex = QRegularExpression(QStringLiteral( + "^Paragraph with an inline \\[1\\] image.\\n\\n--------\\n\\[1\\] " + "http://kde.org/img/kde41.png\\n$")); + QVERIFY(regex.match(result).hasMatch()); + + // height and width + doc->setHtml(QStringLiteral( + "Paragraph with an inline <img src=\"http://kde.org/img/kde41.png\" " + "height=\"10\" width=\"10\" /> image.")); + + delete md; + delete hb; + + hb = new KPIMTextEdit::PlainTextMarkupBuilder(); + md = new KPIMTextEdit::MarkupDirector(hb); + md->processDocument(doc); + result = hb->getResult(); + + regex = QRegularExpression(QStringLiteral( + "^Paragraph with an inline \\[1\\] image.\\n\\n--------\\n\\[1\\] " + "http://kde.org/img/kde41.png\\n$")); + + QVERIFY(regex.match(result).hasMatch()); + delete md; + delete hb; + delete doc; + +} + +void PlainTextMarkupBuilderTest::testEachFormatTagSingly() +{ + QString result; + QRegularExpression regex; + KPIMTextEdit::PlainTextMarkupBuilder *hb; + KPIMTextEdit::MarkupDirector *md; + auto doc = new QTextDocument(); + + // Test bold + doc->setHtml(QStringLiteral("Some <b>formatted</b> text.")); + hb = new KPIMTextEdit::PlainTextMarkupBuilder(); + md = new KPIMTextEdit::MarkupDirector(hb); + md->processDocument(doc); + result = hb->getResult(); + + regex = QRegularExpression(QStringLiteral("^Some \\*formatted\\* text.\\n$")); + QVERIFY(regex.match(result).hasMatch()); + + // Test Italic + doc->setHtml(QStringLiteral("Some <i>formatted</i> text.")); + delete md; + delete hb; + + hb = new KPIMTextEdit::PlainTextMarkupBuilder(); + md = new KPIMTextEdit::MarkupDirector(hb); + md->processDocument(doc); + result = hb->getResult(); + + regex = QRegularExpression(QStringLiteral("^Some /formatted/ text.\\n$")); + QVERIFY(regex.match(result).hasMatch()); + + // Test Underline + doc->setHtml(QStringLiteral("Some <u>formatted</u> text.")); + delete md; + delete hb; + + hb = new KPIMTextEdit::PlainTextMarkupBuilder(); + md = new KPIMTextEdit::MarkupDirector(hb); + md->processDocument(doc); + result = hb->getResult(); + + regex = QRegularExpression(QStringLiteral("^Some _formatted_ text.\\n$")); + QVERIFY(regex.match(result).hasMatch()); + + // Test Strikeout + doc->setHtml(QStringLiteral("Some <s>formatted</s> text.")); + delete md; + delete hb; + + hb = new KPIMTextEdit::PlainTextMarkupBuilder(); + md = new KPIMTextEdit::MarkupDirector(hb); + md->processDocument(doc); + result = hb->getResult(); + + regex = QRegularExpression(QStringLiteral("^Some -formatted- text.\\n$")); + QVERIFY(regex.match(result).hasMatch()); + + // Test Superscript + doc->setHtml(QStringLiteral("Some <sup>formatted</sup> text.")); + delete md; + delete hb; + + hb = new KPIMTextEdit::PlainTextMarkupBuilder(); + md = new KPIMTextEdit::MarkupDirector(hb); + md->processDocument(doc); + result = hb->getResult(); + + regex = QRegularExpression( + QStringLiteral("^Some \\^\\{formatted\\} text.\\n$")); + QVERIFY(regex.match(result).hasMatch()); + + // Test Subscript + doc->setHtml(QStringLiteral("Some <sub>formatted</sub> text.")); + delete md; + delete hb; + + hb = new KPIMTextEdit::PlainTextMarkupBuilder(); + md = new KPIMTextEdit::MarkupDirector(hb); + md->processDocument(doc); + result = hb->getResult(); + + regex + = QRegularExpression(QStringLiteral("^Some _\\{formatted\\} text.\\n$")); + QVERIFY(regex.match(result).hasMatch()); + + // Test Foreground + doc->setHtml(QStringLiteral( + "Some <span style=\"color:#ff0000;\">formatted</span> text.")); + delete md; + delete hb; + + hb = new KPIMTextEdit::PlainTextMarkupBuilder(); + md = new KPIMTextEdit::MarkupDirector(hb); + md->processDocument(doc); + result = hb->getResult(); + + regex = QRegularExpression(QStringLiteral("^Some formatted text.\\n$")); + QVERIFY(regex.match(result).hasMatch()); + + // Test Background + doc->setHtml(QStringLiteral( + "Some <span style=\"background-color:#ff0000;\">formatted</span> text.")); + delete md; + delete hb; + + hb = new KPIMTextEdit::PlainTextMarkupBuilder(); + md = new KPIMTextEdit::MarkupDirector(hb); + md->processDocument(doc); + result = hb->getResult(); + + regex = QRegularExpression(QStringLiteral("^Some formatted text.\\n$")); + QVERIFY(regex.match(result).hasMatch()); + + // Test Font Family + doc->setHtml(QStringLiteral( + "Some <span style=\"font-family:courier;\">formatted</span> text.")); + delete md; + delete hb; + + hb = new KPIMTextEdit::PlainTextMarkupBuilder(); + md = new KPIMTextEdit::MarkupDirector(hb); + md->processDocument(doc); + result = hb->getResult(); + + regex = QRegularExpression(QStringLiteral("^Some formatted text.\\n$")); + QVERIFY(regex.match(result).hasMatch()); + + // Test Font Size + doc->setHtml(QStringLiteral( + "Some <span style=\"font-size:20pt;\">formatted</span> text.")); + delete md; + delete hb; + + hb = new KPIMTextEdit::PlainTextMarkupBuilder(); + md = new KPIMTextEdit::MarkupDirector(hb); + md->processDocument(doc); + result = hb->getResult(); + + regex = QRegularExpression(QStringLiteral("^Some formatted text.\\n$")); + QVERIFY(regex.match(result).hasMatch()); + delete md; + delete hb; + delete doc; + +} + +void PlainTextMarkupBuilderTest::testHorizontalRule() +{ + auto doc = new QTextDocument(); + doc->setHtml( + QStringLiteral("<p style=\"margin-top:0;margin-bottom:0;\">Foo</p><hr " + "/><p style=\"margin-top:0;margin-bottom:0;\">Bar</p>")); + + auto hb = new KPIMTextEdit::PlainTextMarkupBuilder(); + auto md = new KPIMTextEdit::MarkupDirector(hb); + md->processDocument(doc); + auto result = hb->getResult(); + + auto regex = QRegularExpression( + QStringLiteral("^Foo\\n--------------------\\nBar\\n$")); + + QVERIFY(regex.match(result).hasMatch()); + delete md; + delete hb; + delete doc; + +} + +void PlainTextMarkupBuilderTest::testNewlines() +{ + auto doc = new QTextDocument(); + doc->setHtml(QStringLiteral("<p>Foo</p>\n<br /><br />\n<p>Bar</p>")); + + auto hb = new KPIMTextEdit::PlainTextMarkupBuilder(); + auto md = new KPIMTextEdit::MarkupDirector(hb); + md->processDocument(doc); + auto result = hb->getResult(); + + auto regex = QRegularExpression(QStringLiteral("^Foo\\n\\n\\nBar\\n$")); + + QVERIFY(regex.match(result).hasMatch()); + delete md; + delete hb; + delete doc; + +} + +void PlainTextMarkupBuilderTest::testEmptyParagraphs() +{ + auto doc = new QTextDocument(); + doc->setHtml(QStringLiteral("<p>Foo</p>\n<br /><br />\n<p>Bar</p>")); + + auto hb = new KPIMTextEdit::PlainTextMarkupBuilder(); + auto md = new KPIMTextEdit::MarkupDirector(hb); + md->processDocument(doc); + auto result = hb->getResult(); + + auto regex = QRegularExpression(QStringLiteral("^Foo\\n\\n\\nBar\\n$")); + + QVERIFY(regex.match(result).hasMatch()); + delete md; + delete hb; + delete doc; + +} + +void PlainTextMarkupBuilderTest::testNewlinesThroughQTextCursor() +{ + auto doc = new QTextDocument(this); + QTextCursor cursor(doc); + cursor.movePosition(QTextCursor::Start); + cursor.insertText(QStringLiteral("Foo")); + cursor.insertText(QStringLiteral("\n")); + cursor.insertText(QStringLiteral("\n")); + cursor.insertText(QStringLiteral("\n")); + cursor.insertText(QStringLiteral("Bar")); + + auto hb = new KPIMTextEdit::PlainTextMarkupBuilder(); + auto md = new KPIMTextEdit::MarkupDirector(hb); + md->processDocument(doc); + auto result = hb->getResult(); + + auto regex = QRegularExpression(QStringLiteral("^Foo\\n\\n\\nBar\\n$")); + + QVERIFY(regex.match(result).hasMatch()); + delete md; + delete hb; + delete doc; + +} + +void PlainTextMarkupBuilderTest::testBrInsideParagraph() +{ + + auto doc = new QTextDocument(); + doc->setHtml(QStringLiteral("<p>Foo<br /><br /><br />Bar</p>")); + + auto hb = new KPIMTextEdit::PlainTextMarkupBuilder(); + auto md = new KPIMTextEdit::MarkupDirector(hb); + md->processDocument(doc); + auto result = hb->getResult(); + + // Two paragraphs separated by two line breaks + + auto regex = QRegularExpression(QStringLiteral("^Foo\\n\\n\\nBar\\n$")); + + QVERIFY(regex.match(result).hasMatch()); + delete md; + delete hb; + delete doc; + +} + +void PlainTextMarkupBuilderTest::testLongDocument() +{ + QTextDocument doc; + + QFile sourceHtml(QFINDTESTDATA("sourcehtml")); + QVERIFY(sourceHtml.open(QIODevice::ReadOnly)); + doc.setHtml(QString::fromLatin1(sourceHtml.readAll().constData())); + + auto hb = new KPIMTextEdit::PlainTextMarkupBuilder(); + auto md = new KPIMTextEdit::MarkupDirector(hb); + md->processDocument(&doc); + auto result = hb->getResult(); + QVERIFY2( + result.startsWith(QLatin1String("Hello,\nThis is some text\nIt shows how " + "grantlee is used from kmail\n")), + qPrintable(result)); + QVERIFY2(result.endsWith(QLatin1String("This is the end of the signature\n")), + qPrintable(result)); + // qDebug() << result; + delete md; + delete hb; +} + + +void PlainTextMarkupBuilderTest::testBrInsideAnchor() +{ + + auto doc = new QTextDocument(); + doc->setHtml(QStringLiteral("<html><body><p >url: <a href=\"https://www.kde.org\"><span>foo</span></a><br />line1<br />line2</p><p>-- </p><p>bla</p><br /></p></body></html>")); + + auto hb = new KPIMTextEdit::PlainTextMarkupBuilder(); + auto md = new KPIMTextEdit::MarkupDirector(hb); + md->processDocument(doc); + auto result = hb->getResult(); + + auto regex = QRegularExpression(QStringLiteral("^url: foo\\[1\\]\\nline1\\nline2\\n-- \\nbla\\n\n\\n\\n--------\\n\\[1\\] https://www.kde.org\\n$")); + QVERIFY(regex.match(result).hasMatch()); + delete md; + delete hb; + delete doc; } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kpimtextedit-20.04.2/src/grantleebuilder/autotests/plaintextmarkupbuildertest.h new/kpimtextedit-20.04.3/src/grantleebuilder/autotests/plaintextmarkupbuildertest.h --- old/kpimtextedit-20.04.2/src/grantleebuilder/autotests/plaintextmarkupbuildertest.h 2020-05-23 17:45:33.000000000 +0200 +++ new/kpimtextedit-20.04.3/src/grantleebuilder/autotests/plaintextmarkupbuildertest.h 2020-07-02 06:54:50.000000000 +0200 @@ -33,6 +33,33 @@ private Q_SLOTS: void testPlainText(); void testPlainText_data(); + // Test paragraph contents: + void testSingleFormat(); + void testDoubleFormat(); + void testDoubleStartDifferentFinish(); + void testDoubleStartDifferentFinishReverseOrder(); + void testDifferentStartDoubleFinish(); + void testDifferentStartDoubleFinishReverseOrder(); + void testOverlap(); + void testAnchor(); + void testAnchorWithFormattedContent(); + void testAdjacentAnchors(); + void testNestedFormatting(); + void testSpan(); + void testDoubleSpan(); + void testSpanNesting(); + void testEdgeCaseLeft(); + void testEdgeCaseRight(); + void testImage(); + void testImageResized(); + void testEachFormatTagSingly(); + void testHorizontalRule(); + void testNewlines(); + void testEmptyParagraphs(); + void testNewlinesThroughQTextCursor(); + void testBrInsideParagraph(); + void testLongDocument(); + void testBrInsideAnchor(); }; #endif // PLAINTEXTMARKUPBUILDERTEST_H diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kpimtextedit-20.04.2/src/grantleebuilder/autotests/sourcehtml new/kpimtextedit-20.04.3/src/grantleebuilder/autotests/sourcehtml --- old/kpimtextedit-20.04.2/src/grantleebuilder/autotests/sourcehtml 1970-01-01 01:00:00.000000000 +0100 +++ new/kpimtextedit-20.04.3/src/grantleebuilder/autotests/sourcehtml 2020-07-02 06:54:50.000000000 +0200 @@ -0,0 +1,22 @@ +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd"> +<html><head><meta name="qrichtext" content="1" /><style type="text/css"> +p, li { white-space: pre-wrap; } +</style></head><body style=" font-family:&aps;DejaVu Sans&aps;; font-size:13pt; font-weight:400; font-style:normal;"> +<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;">Hello,</p> +<p style="margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; ">This is some text</p> +<p style="margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; ">It shows how grantlee is used from kmail</p> +<p style="margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; ">This is a URL: http://www.kde.org</p> +<p style="margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; ">No problem at all</p> +<p style="margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; ">It all works just fine</p> +<p style="margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; ">This is some text</p> +<p style="margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; ">This is some text</p> +<p style="margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; ">This is some text</p> +<p style="margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; ">This is some text</p> +<p style="margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; ">This is some text</p> +<p style="margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; ">This is some text</p> +<p style="margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; ">This is some text</p> +<p style="margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; ">This is some text</p> +<p style="margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; ">This is some text</p> +<p style="margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; ">This is some text</p> +<p style="margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; ">This is some text</p> +<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;">This is the end of the signature</p></body></html> diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kpimtextedit-20.04.2/src/grantleebuilder/markupdirector.cpp new/kpimtextedit-20.04.3/src/grantleebuilder/markupdirector.cpp --- old/kpimtextedit-20.04.2/src/grantleebuilder/markupdirector.cpp 2020-05-23 17:45:33.000000000 +0200 +++ new/kpimtextedit-20.04.3/src/grantleebuilder/markupdirector.cpp 2020-07-02 06:54:50.000000000 +0200 @@ -141,8 +141,24 @@ return processCharTextObject(it, fragment, textObject); } - if (fragment.text().at(0).category() == QChar::Separator_Line) { - m_builder->addNewline(); + const auto textStr = fragment.text(); + if (textStr.at(0).category() == QChar::Separator_Line) { + m_builder->addSingleBreakLine(); + QString t; + for (int i = 1; i < textStr.length(); ++i) { + if (fragment.text().at(i).category() == QChar::Separator_Line) { + m_builder->appendLiteralText(t); + if (i < textStr.length() -1) { //Don't add \n when we have the last char + m_builder->addSingleBreakLine(); + } + t.clear(); + } else { + t += fragment.text().at(i); + } + } + if (!t.isEmpty()) { + m_builder->appendLiteralText(t); + } if (!it.atEnd()) { return ++it; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kpimtextedit-20.04.2/src/grantleebuilder/plaintextmarkupbuilder.cpp new/kpimtextedit-20.04.3/src/grantleebuilder/plaintextmarkupbuilder.cpp --- old/kpimtextedit-20.04.2/src/grantleebuilder/plaintextmarkupbuilder.cpp 2020-05-23 17:45:33.000000000 +0200 +++ new/kpimtextedit-20.04.3/src/grantleebuilder/plaintextmarkupbuilder.cpp 2020-07-02 06:54:50.000000000 +0200 @@ -216,7 +216,6 @@ Q_D(PlainTextMarkupBuilder); Q_UNUSED(name); if (!d->m_urls.contains(href)) { - d->m_urls.append(href); } d->activeLink = href; ++++++ kpimtextedit-20.04.2.tar.xz.sig -> kpimtextedit-20.04.3.tar.xz.sig ++++++ --- /work/SRC/openSUSE:Factory/kpimtextedit/kpimtextedit-20.04.2.tar.xz.sig 2020-06-14 18:22:15.956023023 +0200 +++ /work/SRC/openSUSE:Factory/.kpimtextedit.new.3060/kpimtextedit-20.04.3.tar.xz.sig 2020-07-14 07:49:47.663945440 +0200 @@ -1,11 +1,11 @@ -----BEGIN PGP SIGNATURE----- -iQEzBAABCgAdFiEE8jJ15L8Qr8HfaRSm29LOiT4tHIcFAl7e3dEACgkQ29LOiT4t -HIfc2Qf+P3cUzrI+RLoGf51FN9gGkr5UL7OZzz0rRVtPrNMjF3RDqAOKNp5tUqvJ -PjoPkn5yDxpv8OQ+FxjF+nPNYuBHTILH0GmGaHIuAw9B/Rl1/snu92/MWLObh37H -cXrnEtRkzZPaD3gIJKgwfJQqEOLQJGBsksLx8G8kEW5L8QlX0ssaUB77koQDyMKO -S2LjRBg7W20lJTvYi+sU4gM+Efq9Ro22gM4m4Izou9vS8KY2v0Icvq0NsSbBpVgv -YXAfzuM0Sxfmg5scCEZiFLB7K3XNJefufSyJsYkuPT7/v0/lNjDIaZt214556HXs -E05omRskGviweLEXqOD8GB/XJq+Ajw== -=W/u1 +iQEzBAABCgAdFiEE8jJ15L8Qr8HfaRSm29LOiT4tHIcFAl8DzRoACgkQ29LOiT4t +HIdh9Qf+NtUYwvrcCmBoQeyIZldD2TgWCGoMnj268sP8VN5liNK4m1suhSmLL1N9 +QaaKWCZBlX/b7uUWhGOLmHX8ba7H55xIbIk6QWh2d2IvnoHI9EqKsMjKj12g0E/S +m42EQsb9rwj1OfjLWqLi4pLCGkXJW397o0NUJ6qTs9CnCD6r9DdWThIrkB2pQoov +9tPRJqVXtW/OISe/QWP7iJ+VPmp7vjd77Y2fCcD2bVM6LquDkEtSUr8O3WkG8aje +z1NaeHlaGriJqbBniLidxtOB+YC/fAZqLyj/kd+Gk/kVpuFRvTs0uZWeTDf93NNl +fOOWX5MYa5jCJbsnRal2/t7D6hHhNA== +=rxg2 -----END PGP SIGNATURE-----
