summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authoralbert-github <albert.tests@gmail.com>2019-09-05 09:32:15 (GMT)
committeralbert-github <albert.tests@gmail.com>2019-09-05 09:32:15 (GMT)
commit9481a8844e5412295dd232e44a04ff8bcf169b5a (patch)
tree3a647e3b2660826bd4a534db07aeac8141d840d1 /src
parent98cc801013b16d827d91567998ead7b24fd78b6d (diff)
downloadDoxygen-9481a8844e5412295dd232e44a04ff8bcf169b5a.zip
Doxygen-9481a8844e5412295dd232e44a04ff8bcf169b5a.tar.gz
Doxygen-9481a8844e5412295dd232e44a04ff8bcf169b5a.tar.bz2
HTML start comment with 3 dashes
A normal HTML comment `<!--` has 2 `-` signs but it is not prohibited to have 3, but doxygen translates `<!---` into `<!-&ndash;` and thus the comment is not recognized. By checking and consequently handling, doing the right skipping, also the 3 `-` sign version the problem can be solved. An end comment cannot contain 3 `-` signs, so here no changes have to take place. The version with 3 or more `-` are in a start HTML comment does not give a problem with xmllint either.
Diffstat (limited to 'src')
-rw-r--r--src/markdown.cpp7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/markdown.cpp b/src/markdown.cpp
index 2cbdcb5..3ee1b71 100644
--- a/src/markdown.cpp
+++ b/src/markdown.cpp
@@ -480,7 +480,8 @@ static int processNmdash(GrowBuf &out,const char *data,int off,int size)
{
count++;
}
- if (count==2 && off>=2 && qstrncmp(data-2,"<!",2)==0) return 0; // start HTML comment
+ 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 && (data[2]=='>')) return 0; // end HTML comment
if (count==2 && (off<8 || qstrncmp(data-8,"operator",8)!=0)) // -- => ndash
{
@@ -1088,6 +1089,10 @@ static void processInline(GrowBuf &out,const char *data,int size)
{
end=i+1;
}
+ else if (end < 0)
+ {
+ end=i-end+1;
+ }
else
{
i+=end;