diff options
author | Ingo Schwarze <schwarze@cvs.openbsd.org> | 2018-12-15 19:30:21 +0000 |
---|---|---|
committer | Ingo Schwarze <schwarze@cvs.openbsd.org> | 2018-12-15 19:30:21 +0000 |
commit | 3962ec0010304a43d14512a8b79da75485655694 (patch) | |
tree | d05b34a3a0c349eea038e76ce0f88596e149de67 /usr.bin/mandoc/mandoc.1 | |
parent | 41d43cda283dfff21b7d5685cb433805d215733e (diff) |
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 'usr.bin/mandoc/mandoc.1')
-rw-r--r-- | usr.bin/mandoc/mandoc.1 | 20 |
1 files changed, 17 insertions, 3 deletions
diff --git a/usr.bin/mandoc/mandoc.1 b/usr.bin/mandoc/mandoc.1 index af46152384c..4413055c909 100644 --- a/usr.bin/mandoc/mandoc.1 +++ b/usr.bin/mandoc/mandoc.1 @@ -1,4 +1,4 @@ -.\" $OpenBSD: mandoc.1,v 1.155 2018/11/22 11:30:15 schwarze Exp $ +.\" $OpenBSD: mandoc.1,v 1.156 2018/12/15 19:30:19 schwarze Exp $ .\" .\" Copyright (c) 2009, 2010, 2011 Kristaps Dzonsons <kristaps@bsd.lv> .\" Copyright (c) 2012, 2014-2018 Ingo Schwarze <schwarze@openbsd.org> @@ -15,7 +15,7 @@ .\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF .\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. .\" -.Dd $Mdocdate: November 22 2018 $ +.Dd $Mdocdate: December 15 2018 $ .Dt MANDOC 1 .Os .Sh NAME @@ -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 |