summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDimitri van Heesch <doxygen@gmail.com>2019-09-16 18:38:22 (GMT)
committerDimitri van Heesch <doxygen@gmail.com>2019-09-16 18:38:22 (GMT)
commit0f90a399a886ea7f69bf482415e6c4cdcb7269b3 (patch)
tree798d24910e6bd77efb3419f82074c4f02edc64c2
parentf0319f91cfee444d47c2abb4b15537d628d36249 (diff)
downloadDoxygen-0f90a399a886ea7f69bf482415e6c4cdcb7269b3.zip
Doxygen-0f90a399a886ea7f69bf482415e6c4cdcb7269b3.tar.gz
Doxygen-0f90a399a886ea7f69bf482415e6c4cdcb7269b3.tar.bz2
Generalized the HTML comment detection and handling
-rw-r--r--src/markdown.cpp11
1 files changed, 3 insertions, 8 deletions
diff --git a/src/markdown.cpp b/src/markdown.cpp
index 48f3dbc..e63bf10 100644
--- a/src/markdown.cpp
+++ b/src/markdown.cpp
@@ -480,8 +480,7 @@ static int processNmdash(GrowBuf &out,const char *data,int off,int size)
{
count++;
}
- if ((count==2 || count==3)&& off>=2 && qstrncmp(data-2,"<!",2)==0) return 2-count; // start HTML comment
- if (count>=4 && off>=2 && qstrncmp(data-2,"<!",2)==0) return -1; // start HTML comment
+ if (count>=2 && off>=2 && qstrncmp(data-2,"<!",2)==0) return 1-count; // start HTML comment
if (count==2 && (data[2]=='>')) return 0; // end HTML comment
if (count==2 && (off<8 || qstrncmp(data-8,"operator",8)!=0)) // -- => ndash
{
@@ -1085,13 +1084,9 @@ static void processInline(GrowBuf &out,const char *data,int size)
if (end>=size) break;
i=end;
end = action(out,data+i,i,size-i);
- if (!end)
+ if (end<=0)
{
- end=i+1;
- }
- else if (end < 0)
- {
- end=i-end+1;
+ end=i+1-end;
}
else
{