aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/mandoc.c
diff options
context:
space:
mode:
authorKristaps Dzonsons <kristaps@bsd.lv>2011-05-15 15:30:33 +0000
committerKristaps Dzonsons <kristaps@bsd.lv>2011-05-15 15:30:33 +0000
commitc462999d899acf87741657ed63dff7612559ce20 (patch)
tree4e1028eea4535afb09994ed28b83f7337878f9e7 /mandoc.c
parent4dc1b5414a1d1531b0c9a1b0061792b0076e329a (diff)
downloadmandoc-c462999d899acf87741657ed63dff7612559ce20.tar.gz
mandoc-c462999d899acf87741657ed63dff7612559ce20.tar.zst
mandoc-c462999d899acf87741657ed63dff7612559ce20.zip
Support groff's escape for Unicode input. See
http://mdocml.bsd.lv/archives/tech/0368.html For the time being, we just throw it away.
Diffstat (limited to 'mandoc.c')
-rw-r--r--mandoc.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/mandoc.c b/mandoc.c
index 671f059a..c9290214 100644
--- a/mandoc.c
+++ b/mandoc.c
@@ -1,4 +1,4 @@
-/* $Id: mandoc.c,v 1.51 2011/05/14 17:54:42 kristaps Exp $ */
+/* $Id: mandoc.c,v 1.52 2011/05/15 15:30:33 kristaps Exp $ */
/*
* Copyright (c) 2008, 2009, 2010 Kristaps Dzonsons <kristaps@bsd.lv>
* Copyright (c) 2011 Ingo Schwarze <schwarze@openbsd.org>
@@ -125,6 +125,14 @@ mandoc_escape(const char **end, const char **start, int *sz)
break;
case ('['):
gly = ESCAPE_SPECIAL;
+ /*
+ * Unicode escapes are defined in groff as \[uXXXX] to
+ * \[u10FFFF], where the contained value must be a valid
+ * Unicode codepoint. Here, however, only check whether
+ * it's not a zero-width escape.
+ */
+ if ('u' == cp[i] && ']' != cp[i + 1])
+ gly = ESCAPE_UNICODE;
term = ']';
break;
case ('C'):