Skip to content

Commit 5f0eb3a

Browse files
committed
issue doxygen#9437 Avoid empty Markdown page get generated
In case of a `@defgroup` or `@addtogroup` at the beginning of a markdown this should be seen as the start of another type of page and handled analogous to what already has been implemented for the `@dir` command
1 parent 33a89a6 commit 5f0eb3a

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

src/markdown.cpp

+7-5
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ enum class ExplicitPageResult
6767
{
6868
explicitPage, /**< docs start with a page command */
6969
explicitMainPage, /**< docs start with a mainpage command */
70-
explicitDirPage, /**< docs start with a dir command */
70+
explicitOtherPage, /**< docs start with a dir / defgroup / addtogroup command */
7171
notExplicit /**< docs doesn't start with either page or mainpage */
7272
};
7373

@@ -3485,11 +3485,13 @@ static ExplicitPageResult isExplicitPage(const QCString &docs)
34853485
}
34863486
else if (i+1<size &&
34873487
(data[i]=='\\' || data[i]=='@') &&
3488-
(literal_at(data.substr(i+1),"dir\n") || literal_at(data.substr(i+1),"dir "))
3488+
(literal_at(data.substr(i+1),"dir\n") || literal_at(data.substr(i+1),"dir ") ||
3489+
literal_at(data.substr(i+1),"defgroup\n") || literal_at(data.substr(i+1),"defgroup ") ||
3490+
literal_at(data.substr(i+1),"addtogroup\n") || literal_at(data.substr(i+1),"addtogroup "))
34893491
)
34903492
{
3491-
AUTO_TRACE_EXIT("result=ExplicitPageResult::explicitDirPage");
3492-
return ExplicitPageResult::explicitDirPage;
3493+
AUTO_TRACE_EXIT("result=ExplicitPageResult::explicitOtherPage");
3494+
return ExplicitPageResult::explicitOtherPage;
34933495
}
34943496
}
34953497
AUTO_TRACE_EXIT("result=ExplicitPageResult::notExplicit");
@@ -3733,7 +3735,7 @@ void MarkdownOutlineParser::parseInput(const QCString &fileName,
37333735
break;
37343736
case ExplicitPageResult::explicitMainPage:
37353737
break;
3736-
case ExplicitPageResult::explicitDirPage:
3738+
case ExplicitPageResult::explicitOtherPage:
37373739
break;
37383740
}
37393741
int lineNr=1;

0 commit comments

Comments
 (0)