summaryrefslogtreecommitdiff
path: root/cli
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2018-03-04 13:48:41 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2018-03-04 13:48:41 +0200
commit25ae2ba76e6b3e0d1c45d426d8ddd7d3b84a5cda (patch)
tree7178c8b7fa9599e4b14298dcbd5f4413d5c33a75 /cli
parent7ba60401433f75e5b63fdc3546b22bed7f26472a (diff)
Add "\ " escaping to specify non-ignorable space
This can used to manually align things (e.g., in synopsis) but will only work if the entire lines are in \c{}.
Diffstat (limited to 'cli')
-rw-r--r--cli/context.cxx25
1 files changed, 25 insertions, 0 deletions
diff --git a/cli/context.cxx b/cli/context.cxx
index f54c474..d2daab4 100644
--- a/cli/context.cxx
+++ b/cli/context.cxx
@@ -437,6 +437,31 @@ format_line (output_type ot, string& r, const char* s, size_t n)
switch (c)
{
+ case ' ':
+ {
+ // Non-ignorable space.
+ //
+ switch (ot)
+ {
+ case ot_plain:
+ {
+ r += ' ';
+ break;
+ }
+ case ot_html:
+ {
+ r += "&#160;";
+ break;
+ }
+ case ot_man:
+ {
+ r += "\\ ";
+ break;
+ }
+ }
+
+ break;
+ }
case '-':
{
// N-dash. If someone wants m-dash, can use \-- with \-{}- as