diff options
author | Rafael G. Martins <rafael@rafaelmartins.eng.br> | 2016-03-05 19:35:16 +0100 |
---|---|---|
committer | Rafael G. Martins <rafael@rafaelmartins.eng.br> | 2016-03-05 19:35:16 +0100 |
commit | 2bfe68f6f9fdd34588b8dde73c1a4e96c5a54b7d (patch) | |
tree | 20ae4f90da8c3397161a6d137b953a378022df6f /src | |
parent | f7034a9c4e26933bceb9b80c6ef492b731df3d73 (diff) | |
download | blogc-2bfe68f6f9fdd34588b8dde73c1a4e96c5a54b7d.tar.gz blogc-2bfe68f6f9fdd34588b8dde73c1a4e96c5a54b7d.tar.bz2 blogc-2bfe68f6f9fdd34588b8dde73c1a4e96c5a54b7d.zip |
content-parser: convert -- and --- to &ndash and &mdash
Diffstat (limited to 'src')
-rw-r--r-- | src/content-parser.c | 15 |
1 files changed, 15 insertions, 0 deletions
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, "&"); |