diff options
-rw-r--r-- | src/fortranscanner.l | 2 | ||||
-rw-r--r-- | src/markdown.cpp | 8 | ||||
-rw-r--r-- | src/markdown.h | 2 | ||||
-rw-r--r-- | src/pyscanner.l | 2 | ||||
-rw-r--r-- | src/scanner.l | 2 | ||||
-rw-r--r-- | src/vhdljjparser.cpp | 7 |
6 files changed, 13 insertions, 10 deletions
diff --git a/src/fortranscanner.l b/src/fortranscanner.l index 4d80d5f..cf48a3e 100644 --- a/src/fortranscanner.l +++ b/src/fortranscanner.l @@ -2518,7 +2518,7 @@ static void handleCommentBlock(yyscan_t yyscanner,const QCString &doc,bool brief int position=0; bool needsEntry = FALSE; Markdown markdown(yyextra->fileName,lineNr); - QCString processedDoc = Config_getBool(MARKDOWN_SUPPORT) ? markdown.process(doc) : doc; + QCString processedDoc = Config_getBool(MARKDOWN_SUPPORT) ? markdown.process(doc,lineNr) : doc; while (yyextra->commentScanner.parseCommentBlock( yyextra->thisParser, yyextra->docBlockInBody ? yyextra->subrCurrent.back().get() : yyextra->current.get(), diff --git a/src/markdown.cpp b/src/markdown.cpp index 2add54c..2863669 100644 --- a/src/markdown.cpp +++ b/src/markdown.cpp @@ -2606,7 +2606,7 @@ QCString Markdown::detab(const QCString &s,int &refIndent) //--------------------------------------------------------------------------- -QCString Markdown::process(const QCString &input) +QCString Markdown::process(const QCString &input, int &startNewlines) { if (input.isEmpty()) return input; int refIndent; @@ -2637,7 +2637,7 @@ QCString Markdown::process(const QCString &input) if (p) { while (*p==' ') p++; // skip over spaces - while (*p=='\n') p++; // skip over newlines + while (*p=='\n') {startNewlines++;p++;}; // skip over newlines if (qstrncmp(p,"<br>",4)==0) p+=4; // skip over <br> } if (p>result.data()) @@ -2726,7 +2726,9 @@ void MarkdownOutlineParser::parseInput(const char *fileName, Protection prot=Public; bool needsEntry = FALSE; int position=0; - QCString processedDocs = markdown.process(docs); + int startNewlines; + QCString processedDocs = markdown.process(docs,startNewlines); + lineNr += startNewlines; while (p->commentScanner.parseCommentBlock( this, current.get(), diff --git a/src/markdown.h b/src/markdown.h index 43a17cc..1210967 100644 --- a/src/markdown.h +++ b/src/markdown.h @@ -33,7 +33,7 @@ class Markdown { public: Markdown(const char *fileName,int lineNr,int indentLevel=0); - QCString process(const QCString &input); + QCString process(const QCString &input, int &startNewlines); QCString extractPageTitle(QCString &docs,QCString &id); void setIndentLevel(int level) { m_indentLevel = level; } diff --git a/src/pyscanner.l b/src/pyscanner.l index 07b39d6..822ea77 100644 --- a/src/pyscanner.l +++ b/src/pyscanner.l @@ -1631,7 +1631,7 @@ static void handleCommentBlock(yyscan_t yyscanner,const QCString &doc,bool brief bool needsEntry; int lineNr = brief ? yyextra->current->briefLine : yyextra->current->docLine; Markdown markdown(yyextra->yyFileName,lineNr); - QCString processedDoc = Config_getBool(MARKDOWN_SUPPORT) ? markdown.process(doc) : doc; + QCString processedDoc = Config_getBool(MARKDOWN_SUPPORT) ? markdown.process(doc,lineNr) : doc; while (yyextra->commentScanner.parseCommentBlock( yyextra->thisParser, (yyextra->docBlockInBody && yyextra->previous) ? yyextra->previous.get() : yyextra->current.get(), diff --git a/src/scanner.l b/src/scanner.l index d9ad41c..e63b8a0 100644 --- a/src/scanner.l +++ b/src/scanner.l @@ -7020,7 +7020,7 @@ static void handleCommentBlock(yyscan_t yyscanner,const QCString &doc,bool brief bool needsEntry=FALSE; Markdown markdown(yyextra->yyFileName,lineNr); QCString strippedDoc = stripIndentation(doc); - QCString processedDoc = Config_getBool(MARKDOWN_SUPPORT) ? markdown.process(strippedDoc) : strippedDoc; + QCString processedDoc = Config_getBool(MARKDOWN_SUPPORT) ? markdown.process(strippedDoc,lineNr) : strippedDoc; while (yyextra->commentScanner.parseCommentBlock( yyextra->thisParser, yyextra->docBlockInBody && yyextra->previous ? yyextra->previous.get() : yyextra->current.get(), diff --git a/src/vhdljjparser.cpp b/src/vhdljjparser.cpp index d3adad2..7c83d52 100644 --- a/src/vhdljjparser.cpp +++ b/src/vhdljjparser.cpp @@ -397,17 +397,18 @@ void VHDLOutlineParser::handleCommentBlock(const char *doc1, bool brief) s->current->docLine = p->yyLineNr; } - + Markdown markdown(p->yyFileName,p->iDocLine); - QCString processedDoc = Config_getBool(MARKDOWN_SUPPORT) ? markdown.process(doc) : doc; + int lineNr = p->iDocLine; + QCString processedDoc = Config_getBool(MARKDOWN_SUPPORT) ? markdown.process(doc,lineNr) : doc; while (p->commentScanner.parseCommentBlock( p->thisParser, s->current.get(), processedDoc, // text p->yyFileName, // file - p->iDocLine, // line of block start + lineNr, // line of block start brief, 0, FALSE, |