summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/commonmark.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/commonmark.c b/src/commonmark.c
index 7864ee6..24c8581 100644
--- a/src/commonmark.c
+++ b/src/commonmark.c
@@ -28,6 +28,7 @@ static CMARK_INLINE void outc(cmark_renderer *renderer, cmark_escaping escape,
renderer->buffer->size > 0 &&
cmark_isdigit(renderer->buffer->ptr[renderer->buffer->size - 1]);
char encoded[ENCODED_SIZE];
+ int options = renderer->options;
needs_escaping =
c < 0x80 && escape != LITERAL &&
@@ -36,6 +37,10 @@ static CMARK_INLINE void outc(cmark_renderer *renderer, cmark_escaping escape,
c == '*' || c == '_' || c == '[' || c == ']' || c == '#' || c == '<' ||
c == '>' || c == '\\' || c == '`' || c == '!' ||
(c == '&' && cmark_isalpha(nextc)) || (c == '!' && nextc == '[') ||
+ ((CMARK_OPT_SMART & options) &&
+ ((c == '-' && nextc == '-') ||
+ (c == '.' && nextc == '.') ||
+ c == '"' || c == '\'')) ||
(renderer->begin_content && (c == '-' || c == '+' || c == '=') &&
// begin_content doesn't get set to false til we've passed digits
// at the beginning of line, so...