Permalink
Browse files

Code with "extension" unparsed shows line numbers

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 2b229f69041023f5f473385ee587ef7743850f55
Showing with 3 additions and 3 deletions.
  1. +3 −3 src/fileparser.cpp
@@ -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
@@ -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++;

0 comments on commit 2b229f6

Please sign in to comment.