cmark

My personal build of CMark ✏️

Commit
dfe48b48179c7779b39da9ba868fa182f8368e38
Parent
ea888d7291523b8e207ab32b66374fa043384e65
Author
John MacFarlane <jgm@berkeley.edu>
Date

commonmark renderer: better escaping of `#`.

Diffstat

1 file changed, 1 insertion, 0 deletions

Status File Name N° Changes Insertions Deletions
Modified src/commonmark.c 1 1 0
diff --git 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])));
 }