summaryrefslogtreecommitdiffstats
path: root/src/commentscan.l
diff options
context:
space:
mode:
authoralbert-github <albert.tests@gmail.com>2018-03-04 12:04:29 (GMT)
committeralbert-github <albert.tests@gmail.com>2018-03-04 12:04:29 (GMT)
commit5bae9d9ec8e5a253d6f5e8f15be43b85cd7ae0ff (patch)
treeb45caa9f4fad606ef6ddf023d79c91b8b65d14bb /src/commentscan.l
parentb6f01ff09b17e5c2288f2418ef0a8f074456c357 (diff)
downloadDoxygen-5bae9d9ec8e5a253d6f5e8f15be43b85cd7ae0ff.zip
Doxygen-5bae9d9ec8e5a253d6f5e8f15be43b85cd7ae0ff.tar.gz
Doxygen-5bae9d9ec8e5a253d6f5e8f15be43b85cd7ae0ff.tar.bz2
Bug 792122 - XHTML pages are broken several ways
The Markdown processing was done after the normal tag processing and splitting the comment in brief, doc, inline. This resulted in that sectioning parts (i.e. e.g. ==== conversion to <h1> ) remained in the brief description whilst similar constructs with HTML commands landed in the doc (details) description. By performing the markdown on the entire comment block this problem has been overcome. commentscan.l - change moment of calling markdown processing - skip start spaces and subsequent empty lines in markdown processed code - small debug correction markdown.cpp - don't convert the dashes in <!-- and --> (HTML type comment) - small debug correction 054 test - update of example for compatibility and adding part about none code result. doxygen.cpp - small textual comment correction
Diffstat (limited to 'src/commentscan.l')
-rw-r--r--src/commentscan.l46
1 files changed, 19 insertions, 27 deletions
diff --git a/src/commentscan.l b/src/commentscan.l
index 588d40a..34db454 100644
--- a/src/commentscan.l
+++ b/src/commentscan.l
@@ -563,14 +563,7 @@ static void addXRefItem(const char *listName,const char *itemTitle,
RefItem *item = refList->getRefItem(lii->itemId);
ASSERT(item!=0);
item->text += " <p>";
- if (Doxygen::markdownSupport)
- {
- item->text += processMarkdown(yyFileName,yyLineNr,current,outputXRef);
- }
- else
- {
- item->text += outputXRef;
- }
+ item->text += outputXRef;
//printf("%s: text +=%s\n",listName,item->text.data());
}
else // new item
@@ -585,14 +578,7 @@ static void addXRefItem(const char *listName,const char *itemTitle,
sprintf(anchorLabel,"_%s%06d",listName,itemId);
RefItem *item = refList->getRefItem(itemId);
ASSERT(item!=0);
- if (Doxygen::markdownSupport)
- {
- item->text = processMarkdown(yyFileName,yyLineNr,current,outputXRef);
- }
- else
- {
- item->text = outputXRef;
- }
+ item->text = outputXRef;
item->listAnchor = anchorLabel;
docEntry->addSpecialListItem(listName,itemId);
QCString cmdString;
@@ -2943,7 +2929,19 @@ bool parseCommentBlock(/* in */ ParserInterface *parser,
langParser = parser;
current = curEntry;
if (comment.isEmpty()) return FALSE; // avoid empty strings
- inputString = comment;
+ if (Doxygen::markdownSupport)
+ {
+ inputString = processMarkdown(fileName,lineNr,NULL,comment);
+ QString qq(inputString);
+ while (qq.startsWith(" ")) qq = qq.mid(1);
+ while (qq.startsWith("\n")) qq = qq.mid(1);
+ if (qq.startsWith("<br>")) qq = qq.mid(4);
+ inputString = QCString(qq.data());
+ }
+ else
+ {
+ inputString = comment;
+ }
inputString.append(" ");
inputPosition = position;
yyLineNr = lineNr;
@@ -2970,7 +2968,7 @@ bool parseCommentBlock(/* in */ ParserInterface *parser,
}
Debug::print(Debug::CommentScan,0,"-----------\nCommentScanner: %s:%d\n"
- "input=[\n%s]\n",qPrint(fileName),lineNr,qPrint(comment)
+ "input=[\n%s]\n",qPrint(fileName),lineNr,qPrint(inputString)
);
commentscanYYrestart( commentscanYYin );
@@ -3008,15 +3006,9 @@ bool parseCommentBlock(/* in */ ParserInterface *parser,
openGroup(current,yyFileName,yyLineNr);
}
- if (Doxygen::markdownSupport)
- {
- current->brief = processMarkdown(fileName,lineNr,current,current->brief);
- current->doc = processMarkdown(fileName,lineNr,current,current->doc);
- current->inbodyDocs = processMarkdown(fileName,lineNr,current,current->inbodyDocs);
- }
-
- Debug::print(Debug::CommentScan,0,
- "brief=[line=%d\n%s]\ndocs=[line=%d\n%s]\ninbody=[line=%d\n%s]\n===========\n",
+ Debug::print(Debug::CommentScan,0,"-----------\nCommentScanner: %s:%d\noutput=[\n"
+ "brief=[line=%d\n%s]\ndocs=[line=%d\n%s]\ninbody=[line=%d\n%s]\n]\n===========\n",
+ qPrint(fileName),lineNr,
current->briefLine,qPrint(current->brief),
current->docLine,qPrint(current->doc),
current->inbodyLine,qPrint(current->inbodyDocs)