@@ -386,6 +386,8 @@ static const std::map< std::string, DocCmdMap > docCmdMap =
386386 { " endmanonly" , { 0 , CommandSpacing::Invisible, SectionHandling::Escape }},
387387 { " endrtfonly" , { 0 , CommandSpacing::Invisible, SectionHandling::Escape }},
388388 { " endxmlonly" , { 0 , CommandSpacing::Invisible, SectionHandling::Escape }},
389+ { " link" , { 0 , CommandSpacing::Invisible, SectionHandling::Replace }},
390+ { " endlink" , { 0 , CommandSpacing::Invisible, SectionHandling::Escape }},
389391 { " ifile" , { &handleIFile, CommandSpacing::Invisible, SectionHandling::Replace }},
390392 { " iline" , { &handleILine, CommandSpacing::Invisible, SectionHandling::Replace }}
391393};
@@ -674,6 +676,7 @@ STopt [^\n@\\]*
674676%x RaiseWarning
675677%x RaiseWarningSection
676678%x Qualifier
679+ %x LinkSection
677680%x IFile
678681%x IFileSection
679682%x ILine
@@ -1750,6 +1753,31 @@ STopt [^\n@\\]*
17501753 }
17511754 }
17521755
1756+ <LinkSection >[^ \\ @ \n ]* {
1757+ yyextra->sectionTitle +=yytext;
1758+ }
1759+ <LinkSection >{CMD }{CMD } {
1760+ yyextra->sectionTitle +=yytext;
1761+ }
1762+ <LinkSection >{DOCNL } {
1763+ addOutput (yyscanner,yytext);
1764+ if (*yytext == ' \n ' ) yyextra->lineNr ++;
1765+ yyextra->sectionTitle +=yytext;
1766+ }
1767+ <LinkSection >{CMD }" endlink" {
1768+ yyextra->sectionTitle +=yytext;
1769+ BEGIN (SectionTitle);
1770+ }
1771+ <LinkSection >. {
1772+ yyextra->sectionTitle +=yytext;
1773+ }
1774+ <LinkSection ><<EOF>> {
1775+ warn (yyextra->fileName ,yyextra->lineNr ,
1776+ " reached end of comment while inside a '\\ %s' command, missing '\\ %s' command" ,
1777+ " link" ," endlink"
1778+ );
1779+ yyterminate ();
1780+ }
17531781 /* ----- handle arguments of the relates(also)/addindex commands ----- */
17541782
17551783<LineParam >{CMD }{CMD } { // escaped command
@@ -1952,6 +1980,11 @@ STopt [^\n@\\]*
19521980 addOutput (yyscanner,yytext);
19531981 BEGIN (IFileSection);
19541982 }
1983+ else if (cmdName == " link" )
1984+ {
1985+ yyextra->sectionTitle +=yytext;
1986+ BEGIN (LinkSection);
1987+ }
19551988 else
19561989 {
19571990 yyextra->sectionTitle +=yytext;
0 commit comments