Skip to content

Commit 7195c67

Browse files
committed
commonmark writer: less aggressive escaping for !.
See #131.
1 parent dfb1526 commit 7195c67

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/commonmark.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,8 @@ static CMARK_INLINE void outc(cmark_renderer *renderer, cmark_escaping escape,
3535
((escape == NORMAL &&
3636
(c < 0x20 ||
3737
c == '*' || c == '_' || c == '[' || c == ']' || c == '#' || c == '<' ||
38-
c == '>' || c == '\\' || c == '`' || c == '!' ||
38+
c == '>' || c == '\\' || c == '`' ||
39+
(c == '!' && (!nextc || nextc == '[')) ||
3940
(c == '&' && cmark_isalpha(nextc)) || (c == '!' && nextc == '[') ||
4041
((CMARK_OPT_SMART & options) &&
4142
((c == '-' && nextc == '-') ||

0 commit comments

Comments
 (0)