Skip to content

Commit

Permalink
Merge pull request vmg#144 from uranusjr/fix-escape-in-comment
Browse files Browse the repository at this point in the history
Special-case comment tag to ignore all its content
  • Loading branch information
mildsunrise committed Jan 1, 2015
2 parents 810c79d + 6d16d19 commit fd09d02
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/html_smartypants.c
Original file line number Diff line number Diff line change
Expand Up @@ -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++;

Expand Down

0 comments on commit fd09d02

Please sign in to comment.