@@ -3446,6 +3446,31 @@ QCString Markdown::Private::processBlocks(std::string_view data,const size_t ind
3446
3446
return out;
3447
3447
}
3448
3448
3449
+ #define OPC (x ) #x " " ,#x " \n "
3450
+ static const StringVector otherPagingCmds =
3451
+ {
3452
+ OPC (dir), OPC (defgroup), OPC (addtogroup), OPC (weakgroup), OPC (ingroup),
3453
+ OPC (fn), OPC (property), OPC (typedef ), OPC (var), OPC (def),
3454
+ OPC (enum ), OPC (namespace ) , OPC (class ), OPC (concept ), OPC (module),
3455
+ OPC (protocol), OPC (category), OPC (union ), OPC (struct ), OPC (interface),
3456
+ OPC (idlexcept)
3457
+ };
3458
+ #undef OPC
3459
+
3460
+ static bool literal_at_local (std::string_view data,const char *str)
3461
+ {
3462
+ size_t len = strlen (str);
3463
+ return len<=data.size () && data[0 ]==str[0 ] && qstrncmp (data.data ()+1 ,str+1 ,len-1 )==0 ;
3464
+ }
3465
+
3466
+ static bool isOtherPage (std::string_view data)
3467
+ {
3468
+ for (const auto &str : otherPagingCmds)
3469
+ {
3470
+ if (literal_at_local (data,str.c_str ())) return true ;
3471
+ }
3472
+ return false ;
3473
+ }
3449
3474
3450
3475
static ExplicitPageResult isExplicitPage (const QCString &docs)
3451
3476
{
@@ -3483,12 +3508,7 @@ static ExplicitPageResult isExplicitPage(const QCString &docs)
3483
3508
return ExplicitPageResult::explicitMainPage;
3484
3509
}
3485
3510
}
3486
- else if (i+1 <size &&
3487
- (data[i]==' \\ ' || data[i]==' @' ) &&
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 " ))
3491
- )
3511
+ else if (i+1 <size && (data[i]==' \\ ' || data[i]==' @' ) && isOtherPage (data.substr (i+1 )))
3492
3512
{
3493
3513
AUTO_TRACE_EXIT (" result=ExplicitPageResult::explicitOtherPage" );
3494
3514
return ExplicitPageResult::explicitOtherPage;
0 commit comments