Skip to content

Commit fce9951

Browse files
committed
issue_8889 ".html_html" attached to some url links when linking to external library
Prevent on other, potential, places a double html extension.
1 parent f6c66d9 commit fce9951

23 files changed

+50
-52
lines changed

src/classdef.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2086,7 +2086,7 @@ void ClassDefImpl::writeTagFile(TextStream &tagFile)
20862086
if (isObjectiveC()) { tagFile << " objc=\"yes\""; }
20872087
tagFile << ">\n";
20882088
tagFile << " <name>" << convertToXML(name()) << "</name>\n";
2089-
tagFile << " <filename>" << convertToXML(getOutputFileBase()) << Doxygen::htmlFileExtension << "</filename>\n";
2089+
tagFile << " <filename>" << convertToXML(addHtmlExtensionIfMissing(getOutputFileBase())) << "</filename>\n";
20902090
if (!anchor().isEmpty())
20912091
{
20922092
tagFile << " <anchor>" << convertToXML(anchor()) << "</anchor>\n";
@@ -2766,7 +2766,7 @@ void ClassDefImpl::writeQuickMemberLinks(OutputList &ol,const MemberDef *current
27662766
ol.writeString("<a class=\"navtab\" ");
27672767
ol.writeString("href=\"");
27682768
if (createSubDirs) ol.writeString("../../");
2769-
ol.writeString(md->getOutputFileBase()+Doxygen::htmlFileExtension+"#"+md->anchor());
2769+
ol.writeString(addHtmlExtensionIfMissing(md->getOutputFileBase())+"#"+md->anchor());
27702770
ol.writeString("\">");
27712771
ol.writeString(convertToHtml(md->name()));
27722772
ol.writeString("</a>");

src/conceptdef.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -270,7 +270,7 @@ void ConceptDefImpl::writeTagFile(TextStream &tagFile)
270270
{
271271
tagFile << " <compound kind=\"concept\">\n";
272272
tagFile << " <name>" << convertToXML(name()) << "</name>\n";
273-
tagFile << " <filename>" << convertToXML(getOutputFileBase()) << Doxygen::htmlFileExtension << "</filename>\n";
273+
tagFile << " <filename>" << convertToXML(addHtmlExtensionIfMissing(getOutputFileBase())) << "</filename>\n";
274274
QCString idStr = id();
275275
if (!idStr.isEmpty())
276276
{

src/context.cpp

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1823,7 +1823,7 @@ class ClassContext::Private : public DefinitionContext<ClassContext::Private>
18231823
{
18241824
cg->writeGraph(t,GOF_BITMAP,EOF_Html,
18251825
g_globals.outputDir,
1826-
g_globals.outputDir+Portable::pathSeparator()+m_classDef->getOutputFileBase()+Doxygen::htmlFileExtension,
1826+
g_globals.outputDir+Portable::pathSeparator()+addHtmlExtensionIfMissing(m_classDef->getOutputFileBase()),
18271827
relPathAsString(),TRUE,TRUE,g_globals.dynSectionId
18281828
);
18291829
}
@@ -1914,7 +1914,7 @@ class ClassContext::Private : public DefinitionContext<ClassContext::Private>
19141914
{
19151915
cg->writeGraph(t,GOF_BITMAP,EOF_Html,
19161916
g_globals.outputDir,
1917-
g_globals.outputDir+Portable::pathSeparator()+m_classDef->getOutputFileBase()+Doxygen::htmlFileExtension,
1917+
g_globals.outputDir+Portable::pathSeparator()+addHtmlExtensionIfMissing(m_classDef->getOutputFileBase()),
19181918
relPathAsString(),TRUE,TRUE,g_globals.dynSectionId
19191919
);
19201920
}
@@ -2800,7 +2800,7 @@ class FileContext::Private : public DefinitionContext<FileContext::Private>
28002800
{
28012801
cg->writeGraph(t,GOF_BITMAP,EOF_Html,
28022802
g_globals.outputDir,
2803-
g_globals.outputDir+Portable::pathSeparator()+m_fileDef->getOutputFileBase()+Doxygen::htmlFileExtension,
2803+
g_globals.outputDir+Portable::pathSeparator()+addHtmlExtensionIfMissing(m_fileDef->getOutputFileBase()),
28042804
relPathAsString(),TRUE,g_globals.dynSectionId
28052805
);
28062806
}
@@ -2842,7 +2842,7 @@ class FileContext::Private : public DefinitionContext<FileContext::Private>
28422842
{
28432843
cg->writeGraph(t,GOF_BITMAP,EOF_Html,
28442844
g_globals.outputDir,
2845-
g_globals.outputDir+Portable::pathSeparator()+m_fileDef->getOutputFileBase()+Doxygen::htmlFileExtension,
2845+
g_globals.outputDir+Portable::pathSeparator()+addHtmlExtensionIfMissing(m_fileDef->getOutputFileBase()),
28462846
relPathAsString(),TRUE,g_globals.dynSectionId
28472847
);
28482848
}
@@ -3163,7 +3163,7 @@ class DirContext::Private : public DefinitionContext<DirContext::Private>
31633163
graph->writeGraph(t,GOF_BITMAP,
31643164
EOF_Html,
31653165
g_globals.outputDir,
3166-
g_globals.outputDir+Portable::pathSeparator()+m_dirDef->getOutputFileBase()+Doxygen::htmlFileExtension,
3166+
g_globals.outputDir+Portable::pathSeparator()+addHtmlExtensionIfMissing(m_dirDef->getOutputFileBase()),
31673167
relPathAsString(),
31683168
TRUE,
31693169
g_globals.dynSectionId,
@@ -3460,7 +3460,7 @@ class TextGeneratorHtml : public TextGeneratorIntf
34603460
}
34613461
m_ts << "href=\"";
34623462
m_ts << externalRef(m_relPath,ref,TRUE);
3463-
if (!f.isEmpty()) m_ts << f << Doxygen::htmlFileExtension;
3463+
if (!f.isEmpty()) m_ts << addHtmlExtensionIfMissing(f);
34643464
if (!anchor.isEmpty()) m_ts << "#" << anchor;
34653465
m_ts << "\">";
34663466
m_ts << convertToHtml(name);
@@ -3747,7 +3747,7 @@ class MemberContext::Private : public DefinitionContext<MemberContext::Private>
37473747
{
37483748
cg->writeGraph(t,GOF_BITMAP,EOF_Html,
37493749
g_globals.outputDir,
3750-
g_globals.outputDir+Portable::pathSeparator()+m_memberDef->getOutputFileBase()+Doxygen::htmlFileExtension,
3750+
g_globals.outputDir+Portable::pathSeparator()+addHtmlExtensionIfMissing(m_memberDef->getOutputFileBase()),
37513751
relPathAsString(),TRUE,g_globals.dynSectionId
37523752
);
37533753
}
@@ -3805,7 +3805,7 @@ class MemberContext::Private : public DefinitionContext<MemberContext::Private>
38053805
{
38063806
cg->writeGraph(t,GOF_BITMAP,EOF_Html,
38073807
g_globals.outputDir,
3808-
g_globals.outputDir+Portable::pathSeparator()+m_memberDef->getOutputFileBase()+Doxygen::htmlFileExtension,
3808+
g_globals.outputDir+Portable::pathSeparator()+addHtmlExtensionIfMissing(m_memberDef->getOutputFileBase()),
38093809
relPathAsString(),TRUE,g_globals.dynSectionId
38103810
);
38113811
}
@@ -4614,7 +4614,7 @@ class ModuleContext::Private : public DefinitionContext<ModuleContext::Private>
46144614
graph->writeGraph(t,GOF_BITMAP,
46154615
EOF_Html,
46164616
g_globals.outputDir,
4617-
g_globals.outputDir+Portable::pathSeparator()+m_groupDef->getOutputFileBase()+Doxygen::htmlFileExtension,
4617+
g_globals.outputDir+Portable::pathSeparator()+addHtmlExtensionIfMissing(m_groupDef->getOutputFileBase()),
46184618
relPathAsString(),
46194619
TRUE,
46204620
g_globals.dynSectionId);

src/definition.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1354,13 +1354,13 @@ QCString DefinitionImpl::navigationPathAsString() const
13541354
if (m_impl->def->definitionType()==Definition::TypeGroup &&
13551355
!toGroupDef(m_impl->def)->groupTitle().isEmpty())
13561356
{
1357-
result+="<a class=\"el\" href=\"$relpath^"+m_impl->def->getOutputFileBase()+Doxygen::htmlFileExtension+"\">"+
1357+
result+="<a class=\"el\" href=\"$relpath^"+addHtmlExtensionIfMissing(m_impl->def->getOutputFileBase())+"\">"+
13581358
convertToHtml(toGroupDef(m_impl->def)->groupTitle())+"</a>";
13591359
}
13601360
else if (m_impl->def->definitionType()==Definition::TypePage &&
13611361
toPageDef(m_impl->def)->hasTitle())
13621362
{
1363-
result+="<a class=\"el\" href=\"$relpath^"+m_impl->def->getOutputFileBase()+Doxygen::htmlFileExtension+"\">"+
1363+
result+="<a class=\"el\" href=\"$relpath^"+addHtmlExtensionIfMissing(m_impl->def->getOutputFileBase())+"\">"+
13641364
convertToHtml((toPageDef(m_impl->def))->title())+"</a>";
13651365
}
13661366
else if (m_impl->def->definitionType()==Definition::TypeClass)
@@ -1370,13 +1370,13 @@ QCString DefinitionImpl::navigationPathAsString() const
13701370
{
13711371
name = name.left(name.length()-2);
13721372
}
1373-
result+="<a class=\"el\" href=\"$relpath^"+m_impl->def->getOutputFileBase()+Doxygen::htmlFileExtension;
1373+
result+="<a class=\"el\" href=\"$relpath^"+addHtmlExtensionIfMissing(m_impl->def->getOutputFileBase());
13741374
if (!m_impl->def->anchor().isEmpty()) result+="#"+m_impl->def->anchor();
13751375
result+="\">"+convertToHtml(name)+"</a>";
13761376
}
13771377
else
13781378
{
1379-
result+="<a class=\"el\" href=\"$relpath^"+m_impl->def->getOutputFileBase()+Doxygen::htmlFileExtension+"\">"+
1379+
result+="<a class=\"el\" href=\"$relpath^"+addHtmlExtensionIfMissing(m_impl->def->getOutputFileBase())+"\">"+
13801380
convertToHtml(locName)+"</a>";
13811381
}
13821382
}

src/diagram.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -255,7 +255,7 @@ static void writeMapArea(TextStream &t,const ClassDef *cd,QCString relPath,
255255
}
256256
t << "href=\"";
257257
t << externalRef(relPath,ref,TRUE);
258-
t << cd->getOutputFileBase() << Doxygen::htmlFileExtension;
258+
t << addHtmlExtensionIfMissing(cd->getOutputFileBase());
259259
if (!cd->anchor().isEmpty())
260260
{
261261
t << "#" << cd->anchor();

src/dirdef.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -466,7 +466,7 @@ void DirDefImpl::writeTagFile(TextStream &tagFile)
466466
tagFile << " <compound kind=\"dir\">\n";
467467
tagFile << " <name>" << convertToXML(displayName()) << "</name>\n";
468468
tagFile << " <path>" << convertToXML(name()) << "</path>\n";
469-
tagFile << " <filename>" << convertToXML(getOutputFileBase()) << Doxygen::htmlFileExtension << "</filename>\n";
469+
tagFile << " <filename>" << addHtmlExtensionIfMissing(getOutputFileBase()) << "</filename>\n";
470470
for (const auto &lde : LayoutDocManager::instance().docEntries(LayoutDocManager::Directory))
471471
{
472472
switch (lde->kind())

src/docsets.cpp

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -261,7 +261,7 @@ void DocSets::addContentsItem(bool isDir,
261261
}
262262
else if (!file.isEmpty()) // doxygen generated file
263263
{
264-
p->nts << file << Doxygen::htmlFileExtension;
264+
p->nts << addHtmlExtensionIfMissing(file);
265265
}
266266
p->nts << "</Path>\n";
267267
if (!file.isEmpty() && !anchor.isEmpty())
@@ -513,8 +513,7 @@ void DocSets::writeToken(TextStream &t,
513513
t << " <Scope>" << convertToXML(scope) << "</Scope>\n";
514514
}
515515
t << " </TokenIdentifier>\n";
516-
t << " <Path>" << d->getOutputFileBase()
517-
<< Doxygen::htmlFileExtension << "</Path>\n";
516+
t << " <Path>" << addHtmlExtensionIfMissing(d->getOutputFileBase()) << "</Path>\n";
518517
if (!anchor.isEmpty())
519518
{
520519
t << " <Anchor>" << anchor << "</Anchor>\n";

src/dotdirdeps.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,7 @@ static void drawDirectory(TextStream &t, const DirDef *const directory, const Do
154154
"style=\"" << getDirectoryBorderStyle(property) << "\", "
155155
"fillcolor=\"" << getDirectoryBackgroundColor(directory->level()-startLevel) << "\", "
156156
"color=\"" << getDirectoryBorderColor(property) << "\", "
157-
"URL=\"" << directory->getOutputFileBase() << Doxygen::htmlFileExtension << "\""
157+
"URL=\"" << addHtmlExtensionIfMissing(directory->getOutputFileBase()) << "\""
158158
"];\n";
159159
directoriesInGraph.insert(std::make_pair(directory->getOutputFileBase().str(), directory));
160160
}
@@ -187,7 +187,7 @@ static void drawClusterOpening(TextStream &outputStream, const DirDef *const dir
187187
outputStream << "\", "
188188
"fontname=\"" << Config_getString(DOT_FONTNAME) << "\", "
189189
"fontsize=\"" << Config_getInt(DOT_FONTSIZE) << "\", "
190-
"URL=\"" << directory->getOutputFileBase() << Doxygen::htmlFileExtension << "\""
190+
"URL=\"" << addHtmlExtensionIfMissing(directory->getOutputFileBase()) << "\""
191191
"]\n";
192192
if (!isAncestor)
193193
{
@@ -386,7 +386,7 @@ void writeDotDirDepGraph(TextStream &t,const DirDef *dd,bool linkRelations)
386386
t << " [headlabel=\"" << (uint)nrefs << "\", labeldistance=1.5";
387387
if (linkRelations)
388388
{
389-
t << " headhref=\"" << relationName << Doxygen::htmlFileExtension << "\"";
389+
t << " headhref=\"" << addHtmlExtensionIfMissing(relationName) << "\"";
390390
}
391391
t << "];\n";
392392
}

src/dotfilepatcher.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,7 @@ static QCString replaceRef(const QCString &buf,const QCString &relPath,
153153
std::unique_ptr<DocRef> df { createRef( *parser.get(), link.mid(5), context ) };
154154
result+=externalRef(relPath,df->ref(),TRUE);
155155
if (!df->file().isEmpty())
156-
result += df->file() + Doxygen::htmlFileExtension;
156+
result += addHtmlExtensionIfMissing(df->file());
157157
if (!df->anchor().isEmpty())
158158
result += "#" + df->anchor();
159159
result += "\"";

src/dotgroupcollaboration.cpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ void DotGroupCollaboration::buildGraph(const GroupDef* gd)
101101
// Add classes
102102
for (const auto &def : gd->getClasses())
103103
{
104-
tmp_url = def->getReference()+"$"+def->getOutputFileBase()+Doxygen::htmlFileExtension;
104+
tmp_url = def->getReference()+"$"+addHtmlExtensionIfMissing(def->getOutputFileBase());
105105
if (!def->anchor().isEmpty())
106106
{
107107
tmp_url+="#"+def->anchor();
@@ -112,21 +112,21 @@ void DotGroupCollaboration::buildGraph(const GroupDef* gd)
112112
// Add namespaces
113113
for (const auto &def : gd->getNamespaces())
114114
{
115-
tmp_url = def->getReference()+"$"+def->getOutputFileBase()+Doxygen::htmlFileExtension;
115+
tmp_url = def->getReference()+"$"+addHtmlExtensionIfMissing(def->getOutputFileBase());
116116
addCollaborationMember( def, tmp_url, DotGroupCollaboration::tnamespace );
117117
}
118118

119119
// Add files
120120
for (const auto &def : gd->getFiles())
121121
{
122-
tmp_url = def->getReference()+"$"+def->getOutputFileBase()+Doxygen::htmlFileExtension;
122+
tmp_url = def->getReference()+"$"+addHtmlExtensionIfMissing(def->getOutputFileBase());
123123
addCollaborationMember( def, tmp_url, DotGroupCollaboration::tfile );
124124
}
125125

126126
// Add pages
127127
for (const auto &def : gd->getPages())
128128
{
129-
tmp_url = def->getReference()+"$"+def->getOutputFileBase()+Doxygen::htmlFileExtension;
129+
tmp_url = def->getReference()+"$"+addHtmlExtensionIfMissing(def->getOutputFileBase());
130130
addCollaborationMember( def, tmp_url, DotGroupCollaboration::tpages );
131131
}
132132

@@ -135,7 +135,7 @@ void DotGroupCollaboration::buildGraph(const GroupDef* gd)
135135
{
136136
for(const auto def : gd->getDirs())
137137
{
138-
tmp_url = def->getReference()+"$"+def->getOutputFileBase()+Doxygen::htmlFileExtension;
138+
tmp_url = def->getReference()+"$"+addHtmlExtensionIfMissing(def->getOutputFileBase());
139139
addCollaborationMember( def, tmp_url, DotGroupCollaboration::tdir );
140140
}
141141
}
@@ -146,7 +146,7 @@ void DotGroupCollaboration::addMemberList( MemberList* ml )
146146
if ( ml==0 || ml->empty() ) return;
147147
for (const auto &def : *ml)
148148
{
149-
QCString tmp_url = def->getReference()+"$"+def->getOutputFileBase()+Doxygen::htmlFileExtension
149+
QCString tmp_url = def->getReference()+"$"+addHtmlExtensionIfMissing(def->getOutputFileBase());
150150
+"#"+def->anchor();
151151
addCollaborationMember( def, tmp_url, DotGroupCollaboration::tmember );
152152
}

0 commit comments

Comments
 (0)