From dfe48b48179c7779b39da9ba868fa182f8368e38 Mon Sep 17 00:00:00 2001
From: John MacFarlane <jgm@berkeley.edu>
Date: Sat, 28 Mar 2015 23:10:28 -0700
Subject: commonmark renderer: better escaping of `#`.

---
 src/commonmark.c | 1 +
 1 file changed, 1 insertion(+)

(limited to 'src')

diff --git a/src/commonmark.c b/src/commonmark.c
index 9606fbe..6347bb5 100644
--- a/src/commonmark.c
+++ b/src/commonmark.c
@@ -48,6 +48,7 @@ needs_escaping(int32_t c, unsigned char next_c, struct render_state *state)
 		(c == '!' && next_c == '[') ||
 		(state->begin_line &&
 		 (c == '-' || c == '+' || c == '#' || c == '=')) ||
+		(c == '#' && (isspace(next_c) || next_c == '\0')) ||
 		((c == '.' || c == ')') &&
 		 isdigit(state->buffer->ptr[state->buffer->size - 1])));
 }
-- 
cgit v1.2.3