summaryrefslogtreecommitdiff
path: root/src/inlines.c
diff options
context:
space:
mode:
authorJohn MacFarlane <jgm@berkeley.edu>2015-02-16 06:44:10 -0800
committerJohn MacFarlane <jgm@berkeley.edu>2015-02-16 06:44:10 -0800
commit3c0b582b52021a6abea644f056a4da4301e2bc30 (patch)
tree237109ea2bc5c56f40f305f7ac7a9ab892542044 /src/inlines.c
parentaf5bff782a9682531da0dec6469748cd0ea48489 (diff)
Properly handle " with no matching close quote with --smart.
This occurs in fiction: when a speaker has dialogue with multiple paragraphs, a close quote is used only on the final one. Added test cases.
Diffstat (limited to 'src/inlines.c')
-rw-r--r--src/inlines.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/inlines.c b/src/inlines.c
index a5af1a5..3b2edbb 100644
--- a/src/inlines.c
+++ b/src/inlines.c
@@ -368,7 +368,7 @@ static cmark_node* handle_delim(subject* subj, unsigned char c, bool smart)
if (c == '\'' && smart) {
contents = cmark_chunk_literal("’");
} else if (c == '"' && smart) {
- contents = cmark_chunk_literal("”");
+ contents = cmark_chunk_literal(can_close ? "”" : "“");
} else {
contents = cmark_chunk_dup(&subj->input, subj->pos - numdelims, numdelims);
}