From c462999d899acf87741657ed63dff7612559ce20 Mon Sep 17 00:00:00 2001 From: Kristaps Dzonsons Date: Sun, 15 May 2011 15:30:33 +0000 Subject: 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. --- mandoc.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'mandoc.c') 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 * Copyright (c) 2011 Ingo Schwarze @@ -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'): -- cgit v1.2.3