diff options
author | albert-github <albert.tests@gmail.com> | 2017-09-28 17:24:31 (GMT) |
---|---|---|
committer | albert-github <albert.tests@gmail.com> | 2017-09-28 17:24:31 (GMT) |
commit | 97bfbfa6c4d4eb07ac8c60545086c3370e9683b8 (patch) | |
tree | b2e84f2dad86974d1279add4cb560bd9d77691ad /src | |
parent | 3aa86cee3f38627f0ee4d0aaac313f8221999819 (diff) | |
download | Doxygen-97bfbfa6c4d4eb07ac8c60545086c3370e9683b8.zip Doxygen-97bfbfa6c4d4eb07ac8c60545086c3370e9683b8.tar.gz Doxygen-97bfbfa6c4d4eb07ac8c60545086c3370e9683b8.tar.bz2 |
Bug 743367 - Duplicate attribute (target="_top" target="_top") generated in .SVG files
prevent to write multiple target attributes in one tag.
Diffstat (limited to 'src')
-rw-r--r-- | src/dot.cpp | 7 | ||||
-rw-r--r-- | src/ftvhelp.cpp | 16 |
2 files changed, 16 insertions, 7 deletions
diff --git a/src/dot.cpp b/src/dot.cpp index 627989f..db77b18 100644 --- a/src/dot.cpp +++ b/src/dot.cpp @@ -291,6 +291,7 @@ static QCString replaceRef(const QCString &buf,const QCString relPath, //bool isXLink=FALSE; int len = 6; int indexS = buf.find("href=\""), indexE; + bool setTarget = FALSE; if (indexS>5 && buf.find("xlink:href=\"")!=-1) // XLink href (for SVG) { indexS-=6; @@ -331,7 +332,9 @@ static QCString replaceRef(const QCString &buf,const QCString relPath, QCString url = link.mid(marker+1); if (!ref.isEmpty()) { - result = externalLinkTarget() + externalRef(relPath,ref,FALSE); + result = externalLinkTarget(); + if (result != "") setTarget = TRUE; + result += externalRef(relPath,ref,FALSE); } result+= href+"=\""; result+=externalRef(relPath,ref,TRUE); @@ -342,7 +345,7 @@ static QCString replaceRef(const QCString &buf,const QCString relPath, result = href+"=\"" + link + "\""; } } - if (!target.isEmpty()) + if (!target.isEmpty() && !setTarget) { result+=" target=\""+target+"\""; } diff --git a/src/ftvhelp.cpp b/src/ftvhelp.cpp index 66ed971..82c2433 100644 --- a/src/ftvhelp.cpp +++ b/src/ftvhelp.cpp @@ -274,6 +274,7 @@ void FTVHelp::generateLink(FTextStream &t,FTVNode *n) { //printf("FTVHelp::generateLink(ref=%s,file=%s,anchor=%s\n", // n->ref.data(),n->file.data(),n->anchor.data()); + bool setTarget = FALSE; if (n->file.isEmpty()) // no link { t << "<b>" << convertToHtml(n->name) << "</b>"; @@ -283,7 +284,9 @@ void FTVHelp::generateLink(FTextStream &t,FTVNode *n) if (!n->ref.isEmpty()) // link to entity imported via tag file { t << "<a class=\"elRef\" "; - t << externalLinkTarget() << externalRef("",n->ref,FALSE); + QCString result = externalLinkTarget(); + if (result != "") setTarget = TRUE; + t << result << externalRef("",n->ref,FALSE); } else // local link { @@ -292,10 +295,13 @@ void FTVHelp::generateLink(FTextStream &t,FTVNode *n) t << "href=\""; t << externalRef("",n->ref,TRUE); t << node2URL(n); - if (m_topLevelIndex) - t << "\" target=\"basefrm\">"; - else - t << "\" target=\"_self\">"; + if (!setTarget) + { + if (m_topLevelIndex) + t << "\" target=\"basefrm\">"; + else + t << "\" target=\"_self\">"; + } t << convertToHtml(n->name); t << "</a>"; if (!n->ref.isEmpty()) |