From 2bfe68f6f9fdd34588b8dde73c1a4e96c5a54b7d Mon Sep 17 00:00:00 2001 From: "Rafael G. Martins" Date: Sat, 5 Mar 2016 19:35:16 +0100 Subject: content-parser: convert -- and --- to &ndash and &mdash --- src/content-parser.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'src') diff --git a/src/content-parser.c b/src/content-parser.c index 7e2310f..f5e3aec 100644 --- a/src/content-parser.c +++ b/src/content-parser.c @@ -361,6 +361,21 @@ blogc_content_parse_inline(const char *src) } break; + case '-': + if (state != LINK_CLOSED) + break; + if (current < (src_len - 1) && src[current + 1] == '-') { + if (current < (src_len - 2) && src[current + 2] == '-') { + sb_string_append(rv, "–"); + current += 2; + } + else { + sb_string_append(rv, "—"); + current += 1; + } + } + break; + case '&': if (state == LINK_CLOSED) sb_string_append(rv, "&"); -- cgit v1.2.3-18-g5258