From 4d9706d81ef5415556289c97f3fbaa899816070c Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Tue, 24 Nov 2015 14:41:49 +0200 Subject: Implement support for n-dash, \- --- cli/context.cxx | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) (limited to 'cli') diff --git a/cli/context.cxx b/cli/context.cxx index b3aebc8..5731222 100644 --- a/cli/context.cxx +++ b/cli/context.cxx @@ -347,6 +347,32 @@ format_line (output_type ot, string& r, const char* s, size_t n) switch (c) { + case '-': + { + // N-dash. If someone wants m-dash, can use \-- with \-{}- as + // a way to "escape" an n-dash followed by hyphen. + // + switch (ot) + { + case ot_plain: + { + r += "--"; + break; + } + case ot_html: + { + r += "–"; + break; + } + case ot_man: + { + r += "\\(en"; + break; + } + } + + break; + } case 'n': { switch (ot) -- cgit v1.1