Utils: fix likelyContainsLink for markdown

This allows us to also port the link in the resource tooltip to
markdown.

Change-Id: Iec0e19ff68db76290139e457694485222f0a38f3
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
This commit is contained in:
David Schulz
2023-05-30 14:08:45 +02:00
parent aa63d5384f
commit 047814c6da
2 changed files with 9 additions and 7 deletions

View File

@@ -181,9 +181,7 @@ QString ResourcePreviewHoverHandler::makeTooltip() const
const Utils::MimeType mimeType = Utils::mimeTypeForFile(m_resPath);
if (mimeType.name().startsWith("image", Qt::CaseInsensitive))
ret += QString("![image](%1) \n").arg(m_resPath);
ret += QString("<a href=\"file:///%1\">%2</a>")
.arg(m_resPath, QDir::toNativeSeparators(m_resPath));
ret += QString("[%1](%2)").arg(QDir::toNativeSeparators(m_resPath), m_resPath);
return ret;
}