summaryrefslogtreecommitdiffstats
path: root/mandoc.1
diff options
context:
space:
mode:
authorIngo Schwarze <schwarze@openbsd.org>2018-12-15 19:30:25 +0000
committerIngo Schwarze <schwarze@openbsd.org>2018-12-15 19:30:25 +0000
commit0e3f0b740ea18224c3b2c07114be601dd8be97bb (patch)
treec930c6fd7e739e926a7fad1c372897af5ea601fb /mandoc.1
parent2b0b19a54638a1b40d908611acc8498a911df29c (diff)
downloadmandoc-0e3f0b740ea18224c3b2c07114be601dd8be97bb.tar.gz
Several improvements to escape sequence handling.
* Add the missing special character \_ (underscore). * Partial implementations of \a (leader character) and \E (uninterpreted escape character). * Parse and ignore \r (reverse line feed). * Add a WARNING message about undefined escape sequences. * Add an UNSUPP message about unsupported escape sequences. * Mark \! and \? (transparent throughput) and \O (suppress output) as unsupported. * Treat the various variants of zero-width spaces as one-byte escape sequences rather than as special characters, to avoid defining bogus forms with square brackets. * For special characters with one-byte names, do not define bogus forms with square brackets, except for \[-], which is valid. * In the form with square brackets, undefined special characters do not fall back to printing the name verbatim, not even for one-byte names. * Starting a special character name with a blank is an error. * Undefined escape sequences never abort formatting of the input string, not even in HTML output mode. * Document the newly handled escapes, and a few that were missing. * Regression tests for most of the above.
Diffstat (limited to 'mandoc.1')
-rw-r--r--mandoc.116
1 files changed, 15 insertions, 1 deletions
diff --git a/mandoc.1 b/mandoc.1
index 91b3003f..7aeaa0b6 100644
--- a/mandoc.1
+++ b/mandoc.1
@@ -1676,7 +1676,8 @@ Start it on a new input line to help formatters produce correct spacing.
.It Sy "invalid escape sequence"
.Pq roff
An escape sequence has an invalid opening argument delimiter, lacks the
-closing argument delimiter, or the argument has too few characters.
+closing argument delimiter, the argument is of an invalid form, or it is
+a character escape sequence with an invalid name.
If the argument is incomplete,
.Ic \e*
and
@@ -1689,6 +1690,12 @@ and
.Ic \ew
to the length of the incomplete argument.
All other invalid escape sequences are ignored.
+.It Sy "undefined escape, printing literally"
+.Pq roff
+In an escape sequence, the first character
+right after the leading backslash is invalid.
+That character is printed literally,
+which is equivalent to ignoring the backslash.
.It Sy "undefined string, using \(dq\(dq"
.Pq roff
If a string is used without being defined before,
@@ -2154,6 +2161,13 @@ implementations but not by
.Nm
was found in an input file.
It is replaced by a question mark.
+.It Sy "unsupported escape sequence"
+.Pq roff
+An input file contains an escape sequence supported by GNU troff
+or Heirloom troff but not by
+.Nm ,
+and it is likely that this will cause information loss
+or considerable misformatting.
.It Sy "unsupported roff request"
.Pq roff
An input file contains a