From 6d16d197353e43b0fc299b8c250bdbff0c581b15 Mon Sep 17 00:00:00 2001 From: Tzu-ping Chung Date: Fri, 14 Nov 2014 10:25:12 +0800 Subject: [PATCH] Special-case comment tag to ignore all its content Fix #143 --- src/html_smartypants.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/html_smartypants.c b/src/html_smartypants.c index bbe4fc5..b0904da 100644 --- a/src/html_smartypants.c +++ b/src/html_smartypants.c @@ -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, "", 3) != 0) + i++; + i += 3; + hoedown_buffer_put(ob, text, i + 1); + return i; + } + while (i < size && text[i] != '>') i++;