summaryrefslogtreecommitdiff
path: root/cli/context.cxx
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2015-11-24 14:41:49 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2015-11-24 14:41:49 +0200
commit4d9706d81ef5415556289c97f3fbaa899816070c (patch)
treec62ecfc85b2050fecb54d717a8c10466cb73104d /cli/context.cxx
parentb8b194ea5fa6ba7a3aac7ff212eb62ccfb942dbf (diff)
Implement support for n-dash, \-
Diffstat (limited to 'cli/context.cxx')
-rw-r--r--cli/context.cxx26
1 files changed, 26 insertions, 0 deletions
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 += "&#8211;";
+ break;
+ }
+ case ot_man:
+ {
+ r += "\\(en";
+ break;
+ }
+ }
+
+ break;
+ }
case 'n':
{
switch (ot)