Skip to content

Commit

Permalink
Code with "extension" unparsed shows line numbers
Browse files Browse the repository at this point in the history
When using a code fragment in "regular" documentation like:
@code
This is a code fragment
@Endcode
this is shown without line numbers but when using {unparsed} or another unknown extension, so
@code{unparsed}
This is a code fragment
@Endcode
line numbers were shown.
(similar for the markdown fenced block).
  • Loading branch information
albert-github committed Aug 30, 2016
1 parent 8b1e673 commit 2b229f6
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/fileparser.cpp
Expand Up @@ -22,7 +22,7 @@ void FileParser::parseCode(CodeOutputInterface &codeOutIntf,
SrcLangExt, // lang
bool, // isExampleBlock
const char *, // exampleName
FileDef *, // fileDef
FileDef * fileDef,
int startLine,
int endLine,
bool, // inlineFragment
Expand All @@ -40,8 +40,8 @@ void FileParser::parseCode(CodeOutputInterface &codeOutIntf,
int j=i;
while (j<length && input[j]!='\n') j++;
QCString lineStr = input.mid(i,j-i);
codeOutIntf.startCodeLine(showLineNumbers);
if (showLineNumbers) codeOutIntf.writeLineNumber(0,0,0,lineNr);
codeOutIntf.startCodeLine(fileDef != 0 && showLineNumbers);
if (fileDef != 0 && showLineNumbers) codeOutIntf.writeLineNumber(0,0,0,lineNr);
if (!lineStr.isEmpty()) codeOutIntf.codify(lineStr);
codeOutIntf.endCodeLine();
lineNr++;
Expand Down

0 comments on commit 2b229f6

Please sign in to comment.