TextHandler: Use the fancy Unicode quotation characters
As per our HIG, we should use these in quotations instead of the normal quote characters.
This commit is contained in:
@@ -535,7 +535,7 @@ void TextHandlerTest::componentOutput_data()
|
|||||||
QVariantMap{{QStringLiteral("class"), QStringLiteral("html")}}}};
|
QVariantMap{{QStringLiteral("class"), QStringLiteral("html")}}}};
|
||||||
QTest::newRow("quote") << QStringLiteral("<p>Text</p>\n<blockquote>\n<p>blockquote</p>\n</blockquote>")
|
QTest::newRow("quote") << QStringLiteral("<p>Text</p>\n<blockquote>\n<p>blockquote</p>\n</blockquote>")
|
||||||
<< QList<MessageComponent>{MessageComponent{MessageComponentType::Text, QStringLiteral("Text"), {}},
|
<< QList<MessageComponent>{MessageComponent{MessageComponentType::Text, QStringLiteral("Text"), {}},
|
||||||
MessageComponent{MessageComponentType::Quote, QStringLiteral("\"blockquote\""), {}}};
|
MessageComponent{MessageComponentType::Quote, QStringLiteral("“blockquote”"), {}}};
|
||||||
QTest::newRow("no tag first paragraph") << QStringLiteral("Text\n<p>Text</p>")
|
QTest::newRow("no tag first paragraph") << QStringLiteral("Text\n<p>Text</p>")
|
||||||
<< QList<MessageComponent>{MessageComponent{MessageComponentType::Text, QStringLiteral("Text"), {}},
|
<< QList<MessageComponent>{MessageComponent{MessageComponentType::Text, QStringLiteral("Text"), {}},
|
||||||
MessageComponent{MessageComponentType::Text, QStringLiteral("Text"), {}}};
|
MessageComponent{MessageComponentType::Text, QStringLiteral("Text"), {}}};
|
||||||
|
|||||||
@@ -413,11 +413,11 @@ QString TextHandler::stripBlockTags(QString string, const QString &tagType) cons
|
|||||||
string.remove(0, string.indexOf(u'>') + 1);
|
string.remove(0, string.indexOf(u'>') + 1);
|
||||||
string.remove(string.indexOf(QLatin1String("</p>")), string.size());
|
string.remove(string.indexOf(QLatin1String("</p>")), string.size());
|
||||||
}
|
}
|
||||||
if (!string.startsWith(u'"')) {
|
if (!string.startsWith(u'“')) {
|
||||||
string.prepend(u'"');
|
string.prepend(u'“');
|
||||||
}
|
}
|
||||||
if (!string.endsWith(u'"')) {
|
if (!string.endsWith(u'”')) {
|
||||||
string.append(u'"');
|
string.append(u'”');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user