Skip to content

Commit 7c27201

Browse files
committed
issue #10606 include command via ALIASES does not work anymore (snippetdoc)
The warning generated in the exampel from #10606 (comment) was like: ``` Modul1.md:12: warning: block marked with [[SNIPPET \ialias{incsnippet1}]] for \snippet{doc} should appear twice in file .../Modul1.pas, found it 0 times, skipping ``` so the end of the "snippet tag" was not properly found, inserting an extra ` \ilinebr` fixes this problem (space is required otherwise the `\linebr` might interfere with arguments with other commands (e.g. with the `\include{doc}` command).
1 parent b06241e commit 7c27201

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

src/commentcnv.l

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1187,11 +1187,11 @@ SLASHopt [/]*
11871187
<CComment,ReadLine,IncludeFile,Verbatim,VerbatimCode>[\\@][a-z_A-Z][a-z_A-Z0-9-]* { // expand alias without arguments
11881188
replaceAliases(yyscanner,yytext,YY_START==ReadLine && yyextra->readLineCtx==SComment);
11891189
}
1190-
<CComment,ReadLine,IncludeFile,Verbatim,VerbatimCode>{B}[\\@]"ialias{" { // expand alias with arguments
1190+
<CComment,ReadLine,IncludeFile,Verbatim,VerbatimCode>{B}"\\ilinebr"{B}[\\@]"ialias{" { // expand alias with arguments
11911191
yyextra->lastBlockContext=YY_START;
11921192
yyextra->blockCount=1;
1193-
yyextra->aliasString=yytext+1;
1194-
yyextra->aliasCmd=yytext+1;
1193+
yyextra->aliasString=yytext+10;
1194+
yyextra->aliasCmd=yytext+10;
11951195
yyextra->lastEscaped=0;
11961196
BEGIN( ReadAliasArgs );
11971197
}
@@ -1819,7 +1819,7 @@ static void replaceAliases(yyscan_t yyscanner,std::string_view s,bool replaceCom
18191819
}
18201820
expAlias.push_back(cmd);
18211821
// add a ialias command to allow expansion of cmd again
1822-
result += " \\ialias{";
1822+
result += " \\ilinebr \\ialias{";
18231823
result += cmd;
18241824
result += "}";
18251825
for (int i=(int)result.length()-1; i>=0; i--)

0 commit comments

Comments
 (0)