diff --git a/src/commentcnv.l b/src/commentcnv.l index daec1e224cb..64339749355 100644 --- a/src/commentcnv.l +++ b/src/commentcnv.l @@ -615,9 +615,9 @@ void replaceComment(int offset); } else { + copyToOutput(yytext,(int)yyleng); if (g_nestingCount<=0) { - copyToOutput(yytext,(int)yyleng); BEGIN(Scan); } else @@ -977,7 +977,7 @@ void convertCppComments(BufStr *inBuf,BufStr *outBuf,const char *fileName) warn(g_fileName,ctx->lineNr,"Conditional section%sdoes not have " "a corresponding \\endcond command within this file.",sectionInfo.data()); } - if (g_nestingCount>0 || YY_START==CComment) + if (g_nestingCount>0 || (YY_START==CComment && g_lang!=SrcLangExt_Markdown)) { warn(g_fileName,g_lineNr,"Reached end of file while still inside a (nested) comment. " "Nesting level %d",g_nestingCount+1); // add one for "normal" expected end of comment diff --git a/src/markdown.cpp b/src/markdown.cpp index ac824f45a7b..85d3c8393df 100644 --- a/src/markdown.cpp +++ b/src/markdown.cpp @@ -2279,14 +2279,7 @@ void MarkdownFileParser::parseInput(const char *fileName, current->fileName = fileName; current->docFile = fileName; current->docLine = 1; - int len = qstrlen(fileBuf); - BufStr input(len); - BufStr output(len); - input.addArray(fileBuf,qstrlen(fileBuf)); - input.addChar('\0'); - convertCppComments(&input,&output,fileName); - output.addChar('\0'); - QCString docs = output.data(); + QCString docs = fileBuf; QCString id; QCString title=extractPageTitle(docs,id).stripWhiteSpace(); QCString titleFn = QFileInfo(fileName).baseName().utf8();