summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorIngo Schwarze <schwarze@openbsd.org>2014-10-28 14:06:31 +0000
committerIngo Schwarze <schwarze@openbsd.org>2014-10-28 14:06:31 +0000
commit9a3f7e6d544fc2f5c114c480cb724e44cfac1ea9 (patch)
treebe723b2ffd9daeda6d2f73221d120c67ea6978ee
parent1af40e20be48508da80ee8a5ee06a4f34351a59c (diff)
downloadmandoc-9a3f7e6d544fc2f5c114c480cb724e44cfac1ea9.tar.gz
stricter parsing of Unicode escape names
-rw-r--r--mandoc_escape.330
1 files changed, 17 insertions, 13 deletions
diff --git a/mandoc_escape.3 b/mandoc_escape.3
index e76601a3..332b94fe 100644
--- a/mandoc_escape.3
+++ b/mandoc_escape.3
@@ -197,15 +197,9 @@ form, directly follows the initial backslash:
Note that the one-character argument short form can only be used for
argument characters that do not clash with escape sequence identifiers.
.Pp
-If the argument consists of more than one character
-and starts with the character
-.Sq u ,
-.Dv ESCAPE_UNICODE
-is returned as described below.
-If the argument is just the single character
-.Sq u ,
-.Dv ESCAPE_ERROR
-is returned.
+If the argument matches one of the forms described below under
+.Dv ESCAPE_UNICODE ,
+that value is returned instead.
.Pp
The
.Dv ESCAPE_SPECIAL
@@ -219,17 +213,27 @@ manual.
.It Dv ESCAPE_UNICODE
Escape sequences of the same format as described above under
.Dv ESCAPE_SPECIAL ,
-but with an argument starting with the character
-.Sq u :
+but with an argument of the forms
+.Ic u Ns Ar XXXX ,
+.Ic u Ns Ar YXXXX ,
+or
+.Ic u10 Ns Ar XXXX
+where
+.Ar X
+and
+.Ar Y
+are hexadecimal digits and
+.Ar Y
+is not zero:
.Ic \eC'u , \e[u .
As a special exception,
.Fa start
is set to the character after the
-.Sq u ,
+.Ic u ,
and the
.Fa sz
return value does not include the
-.Sq u
+.Ic u
either.
.Pp
Such Unicode character escape sequences can be rendered using the function