@@ -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
@@ -3434,6 +3434,18 @@ QCString Markdown::Private::processBlocks(std::string_view data,const size_t ind
34343434 return out;
34353435}
34363436
3437+ static bool isOtherPage (std::string_view data)
3438+ {
3439+ #define OPC (x ) if (literal_at(data,#x " " ) || literal_at(data,#x " \n " )) return true
3440+ OPC (dir); OPC (defgroup); OPC (addtogroup); OPC (weakgroup); OPC (ingroup);
3441+ OPC (fn); OPC (property); OPC (typedef ); OPC (var); OPC (def);
3442+ OPC (enum ); OPC (namespace ) ; OPC (class ); OPC (concept ); OPC (module );
3443+ OPC (protocol); OPC (category); OPC (union ); OPC (struct ); OPC (interface);
3444+ OPC (idlexcept);
3445+ #undef OPC
3446+
3447+ return false ;
3448+ }
34373449
34383450static ExplicitPageResult isExplicitPage (const QCString &docs)
34393451{
@@ -3471,13 +3483,10 @@ static ExplicitPageResult isExplicitPage(const QCString &docs)
34713483 return ExplicitPageResult::explicitMainPage;
34723484 }
34733485 }
3474- else if (i+1 <size &&
3475- (data[i]==' \\ ' || data[i]==' @' ) &&
3476- (literal_at (data.substr (i+1 )," dir\n " ) || literal_at (data.substr (i+1 )," dir " ))
3477- )
3486+ else if (i+1 <size && (data[i]==' \\ ' || data[i]==' @' ) && isOtherPage (data.substr (i+1 )))
34783487 {
3479- AUTO_TRACE_EXIT (" result=ExplicitPageResult::explicitDirPage " );
3480- return ExplicitPageResult::explicitDirPage ;
3488+ AUTO_TRACE_EXIT (" result=ExplicitPageResult::explicitOtherPage " );
3489+ return ExplicitPageResult::explicitOtherPage ;
34813490 }
34823491 }
34833492 AUTO_TRACE_EXIT (" result=ExplicitPageResult::notExplicit" );
@@ -3629,6 +3638,7 @@ void MarkdownOutlineParser::parseInput(const QCString &fileName,
36293638 current->docFile = fileName;
36303639 current->docLine = 1 ;
36313640 QCString docs = stripIndentation (fileBuf);
3641+ if (!docs.stripWhiteSpace ().size ()) return ;
36323642 Debug::print (Debug::Markdown,0 ," ======== Markdown =========\n ---- input ------- \n {}\n " ,fileBuf);
36333643 QCString id;
36343644 Markdown markdown (fileName,1 ,0 );
@@ -3721,7 +3731,7 @@ void MarkdownOutlineParser::parseInput(const QCString &fileName,
37213731 break ;
37223732 case ExplicitPageResult::explicitMainPage:
37233733 break ;
3724- case ExplicitPageResult::explicitDirPage :
3734+ case ExplicitPageResult::explicitOtherPage :
37253735 break ;
37263736 }
37273737 int lineNr=1 ;
0 commit comments