summaryrefslogtreecommitdiffstats
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
commit877bef0b9533150581c911aff80cfbb71c13de8e (patch)
treedd8226017e02a9986ea94aac1ccd95e3035dda59 /mandoc.c
parent6ae46f238194f0cb76bd4e0b8dd456d2be0b960d (diff)
downloadmandoc-877bef0b9533150581c911aff80cfbb71c13de8e.tar.gz
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.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/mandoc.c b/mandoc.c
index 4a9be8e7..9991978d 100644
--- a/mandoc.c
+++ b/mandoc.c
@@ -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'):