summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorDimitri van Heesch <doxygen@gmail.com>2020-12-15 20:24:50 (GMT)
committerDimitri van Heesch <doxygen@gmail.com>2020-12-15 20:24:50 (GMT)
commit7b2e841b3a3d7d787458f236e2447c890cfbf590 (patch)
treeda9a7a6637967222750e8940e389bec9bdbfcb4e /src
parentb8345e73a138c70ba007140dd855bcbcec978e88 (diff)
downloadDoxygen-7b2e841b3a3d7d787458f236e2447c890cfbf590.zip
Doxygen-7b2e841b3a3d7d787458f236e2447c890cfbf590.tar.gz
Doxygen-7b2e841b3a3d7d787458f236e2447c890cfbf590.tar.bz2
issue #8251: Macro stopped working in 1.8,.19
Diffstat (limited to 'src')
-rw-r--r--src/markdown.cpp13
1 files changed, 9 insertions, 4 deletions
diff --git a/src/markdown.cpp b/src/markdown.cpp
index 33a471a..0cf8b87 100644
--- a/src/markdown.cpp
+++ b/src/markdown.cpp
@@ -1693,7 +1693,12 @@ static bool isCodeBlock(const char *data,int offset,int size,int &indent)
// search back 3 lines and remember the start of lines -1 and -2
while (i>0 && nl<3)
{
- if (data[i-offset-1]=='\n') nl_pos[nl++]=i-offset;
+ int j = i-offset-1;
+ int nl_size = isNewline(data+j);
+ if (nl_size>0)
+ {
+ nl_pos[nl++]=j+nl_size;
+ }
i--;
}
@@ -1717,8 +1722,8 @@ static bool isCodeBlock(const char *data,int offset,int size,int &indent)
// determine the indent of line -2
indent=computeIndentExcludingListMarkers(data+nl_pos[2],nl_pos[1]-nl_pos[2]);
- //printf(">isCodeBlock local_indent %d>=%d+4=%d\n",
- // indent0,indent2,indent0>=indent2+4);
+ //printf(">isCodeBlock local_indent %d>=%d+%d=%d\n",
+ // indent0,indent,codeBlockIndent,indent0>=indent+codeBlockIndent);
// if the difference is >4 spaces -> code block
return indent0>=indent+codeBlockIndent;
}
@@ -2152,7 +2157,7 @@ int Markdown::writeCodeBlock(const char *data,int size,int refIndent)
TRACE(data);
int i=0,end;
//printf("writeCodeBlock: data={%s}\n",QCString(data).left(size).data());
- // no need for \ilinebr here as the prvious like was empty and was skipped
+ // no need for \ilinebr here as the previous line was empty and was skipped
m_out.addStr("@verbatim\n");
int emptyLines=0;
while (i<size)