summaryrefslogtreecommitdiffstats
path: root/src/markdown.cpp
diff options
context:
space:
mode:
authorDimitri van Heesch <dimitri@stack.nl>2014-01-26 14:17:47 (GMT)
committerDimitri van Heesch <dimitri@stack.nl>2014-01-26 14:17:47 (GMT)
commit60ea06a68f2e355e34b61bf45babc6405bfbfe84 (patch)
tree556f2bc076cae6fcebd42737f061f4a8395e00e6 /src/markdown.cpp
parent0e9da9fb27147c5685088019afd428a0aaa901fa (diff)
downloadDoxygen-60ea06a68f2e355e34b61bf45babc6405bfbfe84.zip
Doxygen-60ea06a68f2e355e34b61bf45babc6405bfbfe84.tar.gz
Doxygen-60ea06a68f2e355e34b61bf45babc6405bfbfe84.tar.bz2
Bug 722711 - [PATCH] Link refs with no title swallow an extra newline
Diffstat (limited to 'src/markdown.cpp')
-rw-r--r--src/markdown.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/markdown.cpp b/src/markdown.cpp
index 85d3c83..fe74610 100644
--- a/src/markdown.cpp
+++ b/src/markdown.cpp
@@ -1133,8 +1133,8 @@ static int isLinkRef(const char *data,int size,
while (i<size && data[i]==' ') i++;
if (i<size && data[i]=='\n')
{
- i++;
eol=i;
+ i++;
while (i<size && data[i]==' ') i++;
}
if (i>=size)
@@ -1152,6 +1152,7 @@ static int isLinkRef(const char *data,int size,
int titleStart=i;
// search for end of the line
while (i<size && data[i]!='\n') i++;
+ eol = i;
// search back to matching character
int end=i-1;
@@ -1166,8 +1167,7 @@ static int isLinkRef(const char *data,int size,
//printf("end of isLinkRef: i=%d size=%d data[i]='%c' eol=%d\n",
// i,size,data[i],eol);
if (i>=size) return i; // end of buffer while ref id was found
- else if (data[i]=='\n') return i+1; // end of line while ref id was found
- else if (eol) return eol; // no optional title found
+ else if (eol) return eol; // end of line while ref id was found
return 0; // invalid link ref
}