mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-07-13 01:39:29 -04:00
add tooltips with address to urls
This commit is contained in:
parent
68b35f3b9a
commit
df244fd44d
1 changed files with 28 additions and 0 deletions
|
@ -388,6 +388,20 @@ void RsHtml::embedHtml(QTextDocument *textDocument, QDomDocument& doc, QDomEleme
|
||||||
replaceAnchorWithImg(doc, element, textDocument, link);
|
replaceAnchorWithImg(doc, element, textDocument, link);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
QUrl url(element.attribute("href"));
|
||||||
|
if(url.isValid())
|
||||||
|
{
|
||||||
|
QString title = url.host();
|
||||||
|
if (!title.isEmpty()) {
|
||||||
|
element.setAttribute("title", title);
|
||||||
|
}
|
||||||
|
if (textDocument && (flag & RSHTML_FORMATTEXT_REPLACE_LINKS)) {
|
||||||
|
replaceAnchorWithImg(doc, element, textDocument, url);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
if (textDocument && (flag & RSHTML_FORMATTEXT_REPLACE_LINKS)) {
|
if (textDocument && (flag & RSHTML_FORMATTEXT_REPLACE_LINKS)) {
|
||||||
RetroShareLink link(element.attribute("href"));
|
RetroShareLink link(element.attribute("href"));
|
||||||
|
@ -443,6 +457,20 @@ void RsHtml::embedHtml(QTextDocument *textDocument, QDomDocument& doc, QDomEleme
|
||||||
replaceAnchorWithImg(doc, insertedTag, textDocument, link);
|
replaceAnchorWithImg(doc, insertedTag, textDocument, link);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
QUrl url(myRE.cap(0));
|
||||||
|
if(url.isValid())
|
||||||
|
{
|
||||||
|
QString title = url.host();
|
||||||
|
if (!title.isEmpty()) {
|
||||||
|
insertedTag.setAttribute("title", title);
|
||||||
|
}
|
||||||
|
if (textDocument && (flag & RSHTML_FORMATTEXT_REPLACE_LINKS)) {
|
||||||
|
replaceAnchorWithImg(doc, insertedTag, textDocument, url);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case Img:
|
case Img:
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue