summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/commonmark.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/commonmark.c b/src/commonmark.c
index b8ff25b..c266bf6 100644
--- a/src/commonmark.c
+++ b/src/commonmark.c
@@ -417,7 +417,7 @@ S_render_node(cmark_node *node, cmark_event_type ev_type,
lit(state, " ", false);
}
out(state, node->as.literal, true, LITERAL);
- if (code->data[code->len - 1] == '`') {
+ if (code->len == 0 || code->data[code->len - 1] == '`') {
lit(state, " ", false);
}
for (i = 0; i < numticks; i++) {