Trim Link Preview Text

Trim the text from the link preview title and description to ensure no whitespace at the beginning.
This commit is contained in:
James Graham
2022-11-07 17:26:03 +00:00
parent a97761f65c
commit 364ce45668

View File

@@ -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();