mirror of
https://github.com/RetroShare/RetroShare.git
synced 2024-10-01 02:35:48 -04:00
Fixed handling of html links in HandleRichText::formatText.
git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@5162 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
parent
02a7548de4
commit
27c0535a8a
@ -277,18 +277,17 @@ void RsHtml::embedHtml(QTextDocument *textDocument, QDomDocument& doc, QDomEleme
|
||||
switch(embedInfos.myType) {
|
||||
case Ahref:
|
||||
{
|
||||
RetroShareLink link(embedInfos.myRE.cap(0));
|
||||
if (link.valid()) {
|
||||
insertedTag = doc.createElement("a");
|
||||
insertedTag.setAttribute("href", embedInfos.myRE.cap(0));
|
||||
insertedTag.appendChild(doc.createTextNode(embedInfos.myRE.cap(0)));
|
||||
|
||||
RetroShareLink link(embedInfos.myRE.cap(0));
|
||||
if (link.valid()) {
|
||||
QString title = link.title();
|
||||
if (!title.isEmpty()) {
|
||||
insertedTag.setAttribute("title", title);
|
||||
}
|
||||
|
||||
insertedTag.appendChild(doc.createTextNode(embedInfos.myRE.cap(0)));
|
||||
|
||||
if (textDocument && (flag & RSHTML_FORMATTEXT_REPLACE_LINKS)) {
|
||||
replaceAnchorWithImg(doc, insertedTag, textDocument, link);
|
||||
}
|
||||
@ -304,10 +303,8 @@ void RsHtml::embedHtml(QTextDocument *textDocument, QDomDocument& doc, QDomEleme
|
||||
break;
|
||||
}
|
||||
|
||||
if (!insertedTag.isNull()) {
|
||||
currentElement.insertBefore(insertedTag, node);
|
||||
index++;
|
||||
}
|
||||
|
||||
currentPos = nextPos + embedInfos.myRE.matchedLength();
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user