X-Git-Url: https://git.cameronkatri.com/mandoc.git/blobdiff_plain/3734245a5a164c1ba48ac02cb3131143431b996b..92d36306307652f916347656b5c31928db651c45:/out.c diff --git a/out.c b/out.c index 5bc69ca2..8be9514e 100644 --- a/out.c +++ b/out.c @@ -1,4 +1,4 @@ -/* $Id: out.c,v 1.25 2010/08/24 12:18:49 kristaps Exp $ */ +/* $Id: out.c,v 1.28 2010/08/24 13:56:51 kristaps Exp $ */ /* * Copyright (c) 2009, 2010 Kristaps Dzonsons * @@ -220,6 +220,8 @@ a2roffdeco(enum roffdeco *d, const char **word, size_t *sz) break; } break; + case ('k'): + /* FALLTHROUGH */ case ('M'): /* FALLTHROUGH */ case ('m'): @@ -277,6 +279,26 @@ a2roffdeco(enum roffdeco *d, const char **word, size_t *sz) i++; } + /* Handle embedded numerical subexp or escape. */ + + if ('(' == wp[i]) { + while (wp[i] && ')' != wp[i]) + if ('\\' == wp[i++]) { + /* Handle embedded escape. */ + *word = &wp[i]; + i += a2roffdeco(&dd, word, sz); + } + + if (')' == wp[i++]) + break; + + *d = DECO_NONE; + return(i - 1); + } else if ('\\' == wp[i]) { + *word = &wp[++i]; + i += a2roffdeco(&dd, word, sz); + } + break; case ('['): *d = DECO_SPECIAL; @@ -293,6 +315,12 @@ a2roffdeco(enum roffdeco *d, const char **word, size_t *sz) } else lim = 1; break; + case ('w'): + if ('\'' == wp[i++]) { + term = '\''; + break; + } + /* FALLTHROUGH */ default: *d = DECO_SSPECIAL; i--;