Fix [Please visit our booth 24-25 http://example.com/]
CCBUG:363427
Gbp-Pq: Name Fix-Bug-363427-unsafe-characters-incorrectly-parsed-as-pa.patch
QTest::newRow("url-with-ref-in-[") << "https://www.kde.org[1]"
<< KTextToHTML::Options(KTextToHTML::PreserveSpaces)
<< "<a href=\"https://www.kde.org\">https://www.kde.org</a>[1]";
+
+ QTest::newRow("url-with-ref-in-[2") << "[http://www.example.org/][whatever]"
+ << KTextToHTML::Options(KTextToHTML::PreserveSpaces)
+ << "[<a href=\"http://www.example.org/\">http://www.example.org/</a>][whatever]";
+
+ QTest::newRow("url-with-ref-in-]") << "[Please visit our booth 24-25 http://example.com/]"
+ << KTextToHTML::Options(KTextToHTML::PreserveSpaces)
+ << "[Please visit our booth 24-25 <a href=\"http://example.com/\">http://example.com/</a>]";
}
previousCharIsSpace = true;
} else if (!previousIsAnAnchor && mText[mPos] == QLatin1Char('[')) {
break;
+ } else if (!previousIsAnAnchor && mText[mPos] == QLatin1Char(']')) {
+ break;
} else { // skip whitespace
if (previousCharIsSpace && mText[mPos] == QLatin1Char('<')) {
url.append(QLatin1Char(' '));