Skip to content

Commit f5944b1

Browse files
committed
issue #10958 Markdown: unordered list
In #10858 (comment) a problem was mentioned regarding the `\include{doc}` command. - getting to have proper indentations for further processing after insertion of a file / snippet (and adjusting line number because of extra `\n`). - needed to support line number 0 as well for the `\iline` command
1 parent 7323ef1 commit f5944b1

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

src/commentcnv.l

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1697,6 +1697,7 @@ static bool readIncludeFile(yyscan_t yyscanner,const QCString &inc,const QCStrin
16971697
QCString oldRaiseLabel = yyextra->raiseLabel;
16981698
yyextra->raiseLevel+=yyextra->raiseIncrement;
16991699
yyextra->raiseLabel+=yyextra->raisePrefix;
1700+
lineNr--;
17001701
QCString lineStr=" \\ilinebr \\ifile \""+absFileName+"\" \\iline " + std::to_string(lineNr);
17011702
if (yyextra->raiseLevel>0)
17021703
{
@@ -1706,12 +1707,14 @@ static bool readIncludeFile(yyscan_t yyscanner,const QCString &inc,const QCStrin
17061707
{
17071708
lineStr+=" \\iprefix \"" + yyextra->raiseLabel + "\"";
17081709
}
1709-
lineStr+=" \\ilinebr ";
1710+
copyToOutput(yyscanner,lineStr.view());
1711+
insertCommentStart(yyscanner);
1712+
lineStr="\n";
17101713
copyToOutput(yyscanner,lineStr.view());
17111714
17121715
fs->fileName = absFileName;
17131716
fs->bufState = YY_CURRENT_BUFFER;
1714-
fs->oldLineNr = yyextra->lineNr;
1717+
fs->oldLineNr = yyextra->lineNr-1;
17151718
fs->oldFileName = yyextra->fileName;
17161719
fs->oldState = yyextra->includeCtx;
17171720
fs->oldFileBuf = yyextra->inBuf;

src/doctokenizer.l

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -348,7 +348,7 @@ REFWORD4 {REFWORD4_NOCV}{CVSPEC}?
348348
REFWORD {FILEMASK}|{LABELID}|{REFWORD2}|{REFWORD3}|{REFWORD4}
349349
REFWORD_NOCV {FILEMASK}|{LABELID}|{REFWORD2_NOCV}|{REFWORD3}|{REFWORD4_NOCV}
350350
RCSID "$"("Author"|"Date"|"Header"|"Id"|"Locker"|"Log"|"Name"|"RCSfile"|"Revision"|"Source"|"State")":"[^:\n$][^\n$]*"$"
351-
LINENR {BLANK}*[1-9][0-9]*
351+
LINENR {BLANK}*([1-9][0-9]*|"0")
352352

353353
SHOWDATE ([0-9]{4}"-"[0-9]{1,2}"-"[0-9]{1,2})?({WS}*[0-9]{1,2}":"[0-9]{1,2}(":"[0-9]{1,2})?)?
354354

0 commit comments

Comments
 (0)