From 364ce456683f03a9bec8732a3ae4e5b60743454d Mon Sep 17 00:00:00 2001 From: James Graham Date: Mon, 7 Nov 2022 17:26:03 +0000 Subject: [PATCH] Trim Link Preview Text Trim the text from the link preview title and description to ensure no whitespace at the beginning. --- src/linkpreviewer.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/linkpreviewer.cpp b/src/linkpreviewer.cpp index fe5bc689c..0f0b86daf 100644 --- a/src/linkpreviewer.cpp +++ b/src/linkpreviewer.cpp @@ -56,8 +56,8 @@ void LinkPreviewer::setUrl(QUrl url) connect(job, &BaseJob::success, this, [this, job]() { const auto json = job->jsonData(); - m_title = json["og:title"].toString(); - m_description = json["og:description"].toString(); + m_title = json["og:title"].toString().trimmed(); + m_description = json["og:description"].toString().trimmed(); m_imageSource = json["og:image"].toString(); m_loaded = true; Q_EMIT titleChanged();