Special-case comment tag to ignore all its content

Fix #143
This commit is contained in:
Tzu-ping Chung 2014-11-14 10:25:12 +08:00
parent 3afc3ec505
commit 6d16d19735

View file

@ -313,6 +313,16 @@ smartypants_cb__ltag(hoedown_buffer *ob, struct smartypants_data *smrt, uint8_t
size_t tag, i = 0;
/* This is a comment. Copy everything verbatim until --> or EOF is seen. */
if (i + 4 < size && memcmp(text, "<!--", 4) == 0) {
i += 4;
while (i + 3 < size && memcmp(text + i, "-->", 3) != 0)
i++;
i += 3;
hoedown_buffer_put(ob, text, i + 1);
return i;
}
while (i < size && text[i] != '>')
i++;