From 0f90a399a886ea7f69bf482415e6c4cdcb7269b3 Mon Sep 17 00:00:00 2001 From: Dimitri van Heesch Date: Mon, 16 Sep 2019 20:38:22 +0200 Subject: Generalized the HTML comment detection and handling --- src/markdown.cpp | 11 +++-------- 1 file 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,"=4 && off>=2 && qstrncmp(data-2,"=2 && off>=2 && qstrncmp(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 { -- cgit v0.12