Skip to content

Commit f6f32df

Browse files
committed
issue doxygen#11631 Doxygen generates incorrect links for nested README.md files in subfolders
In case of a readme file and implicit directories documentation set create a link to the correct file (describing the directory)
1 parent 0aa2496 commit f6f32df

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

src/docnode.cpp

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -757,6 +757,20 @@ DocRef::DocRef(DocParser *parser,DocNodeVariant *parent,const QCString &target,c
757757
AUTO_TRACE_EXIT("section");
758758
return;
759759
}
760+
else if (Config_getBool(IMPLICIT_DIR_DOCS) && target.lower().endsWith("/readme.md"))
761+
{
762+
QCString dirTarget = target.left(target.length() - 9);
763+
for (const auto &dd : *Doxygen::dirLinkedMap)
764+
{
765+
if (dd->name() == dirTarget)
766+
{
767+
m_text = target;
768+
m_file = dd->getOutputFileBase();
769+
AUTO_TRACE_EXIT("directory");
770+
return;
771+
}
772+
}
773+
}
760774
else if (resolveLink(context,target,true,&compound,anchor,lang,parser->context.prefix))
761775
{
762776
bool isFile = compound ?

0 commit comments

Comments
 (0)