Skip to content

Commit fd09d02

Browse files
committed
Merge pull request vmg#144 from uranusjr/fix-escape-in-comment
Special-case comment tag to ignore all its content
2 parents 810c79d + 6d16d19 commit fd09d02

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

src/html_smartypants.c

+10
Original file line numberDiff line numberDiff line change
@@ -313,6 +313,16 @@ smartypants_cb__ltag(hoedown_buffer *ob, struct smartypants_data *smrt, uint8_t
313313

314314
size_t tag, i = 0;
315315

316+
/* This is a comment. Copy everything verbatim until --> or EOF is seen. */
317+
if (i + 4 < size && memcmp(text, "<!--", 4) == 0) {
318+
i += 4;
319+
while (i + 3 < size && memcmp(text + i, "-->", 3) != 0)
320+
i++;
321+
i += 3;
322+
hoedown_buffer_put(ob, text, i + 1);
323+
return i;
324+
}
325+
316326
while (i < size && text[i] != '>')
317327
i++;
318328

0 commit comments

Comments
 (0)