Fix handling line separators
BUG: 468977
(cherry picked from commit 2b06679be6)
This commit is contained in:
@@ -59,6 +59,8 @@ private Q_SLOTS:
|
|||||||
void receiveRichtextIn();
|
void receiveRichtextIn();
|
||||||
void receiveRichMxcUrl();
|
void receiveRichMxcUrl();
|
||||||
void receiveRichPlainUrl();
|
void receiveRichPlainUrl();
|
||||||
|
|
||||||
|
void receiveLineSeparator();
|
||||||
};
|
};
|
||||||
|
|
||||||
#ifdef QUOTIENT_07
|
#ifdef QUOTIENT_07
|
||||||
@@ -498,5 +500,13 @@ void TextHandlerTest::receiveRichPlainUrl()
|
|||||||
QCOMPARE(testTextHandler.handleRecieveRichText(Qt::RichText), testOutputStringMxId);
|
QCOMPARE(testTextHandler.handleRecieveRichText(Qt::RichText), testOutputStringMxId);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void TextHandlerTest::receiveLineSeparator()
|
||||||
|
{
|
||||||
|
auto text = QStringLiteral("foo\u2028bar");
|
||||||
|
TextHandler textHandler;
|
||||||
|
textHandler.setData(text);
|
||||||
|
QCOMPARE(textHandler.handleRecievePlainText(Qt::PlainText, true), QStringLiteral("foo bar"));
|
||||||
|
}
|
||||||
|
|
||||||
QTEST_MAIN(TextHandlerTest)
|
QTEST_MAIN(TextHandlerTest)
|
||||||
#include "texthandlertest.moc"
|
#include "texthandlertest.moc"
|
||||||
|
|||||||
@@ -169,6 +169,7 @@ QString TextHandler::handleRecievePlainText(Qt::TextFormat inputFormat, const bo
|
|||||||
m_dataBuffer.replace(QStringLiteral("<br />\n"), QStringLiteral(" "));
|
m_dataBuffer.replace(QStringLiteral("<br />\n"), QStringLiteral(" "));
|
||||||
m_dataBuffer.replace(QStringLiteral("<br />"), QStringLiteral(" "));
|
m_dataBuffer.replace(QStringLiteral("<br />"), QStringLiteral(" "));
|
||||||
m_dataBuffer.replace(u'\n', QStringLiteral(" "));
|
m_dataBuffer.replace(u'\n', QStringLiteral(" "));
|
||||||
|
m_dataBuffer.replace(u'\u2028', " ");
|
||||||
}
|
}
|
||||||
|
|
||||||
// Strip all tags/attributes except code blocks which will be escaped.
|
// Strip all tags/attributes except code blocks which will be escaped.
|
||||||
|
|||||||
Reference in New Issue
Block a user