mirror of
https://git.jami.net/savoirfairelinux/jami-client-qt.git
synced 2025-09-05 14:43:39 +02:00
link-previews: strip Windows EOLs too when parsing meta tags
Change-Id: I54cd44a3ef388321c411b7c45985aa1808d380c8
This commit is contained in:
parent
1b51dcc8e6
commit
6ce57d6a90
1 changed files with 2 additions and 2 deletions
|
@ -27,7 +27,8 @@ getInnerHtml(const QString& tag)
|
||||||
return match.hasMatch() ? match.captured(1) : QString {};
|
return match.hasMatch() ? match.captured(1) : QString {};
|
||||||
};
|
};
|
||||||
|
|
||||||
const QRegularExpression PreviewEngine::newlineRe("\\n");
|
// Portable newline regex.
|
||||||
|
const QRegularExpression PreviewEngine::newlineRe("\\r?\\n");
|
||||||
|
|
||||||
PreviewEngine::PreviewEngine(ConnectivityMonitor* cm, QObject* parent)
|
PreviewEngine::PreviewEngine(ConnectivityMonitor* cm, QObject* parent)
|
||||||
: NetworkManager(cm, parent)
|
: NetworkManager(cm, parent)
|
||||||
|
@ -83,7 +84,6 @@ PreviewEngine::getDescription(HtmlParser::TagInfoList& metaTags)
|
||||||
QString
|
QString
|
||||||
PreviewEngine::getImage(HtmlParser::TagInfoList& metaTags)
|
PreviewEngine::getImage(HtmlParser::TagInfoList& metaTags)
|
||||||
{
|
{
|
||||||
static const QRegularExpression newlineRe("\\n");
|
|
||||||
// Try with og/twitter props
|
// Try with og/twitter props
|
||||||
QString image = getTagContent(metaTags[TidyTag_META], "image");
|
QString image = getTagContent(metaTags[TidyTag_META], "image");
|
||||||
if (image.isEmpty()) { // Try with href of link tag (rel="image_src")
|
if (image.isEmpty()) { // Try with href of link tag (rel="image_src")
|
||||||
|
|
Loading…
Add table
Reference in a new issue