diff options
author | Ingo Schwarze <schwarze@openbsd.org> | 2015-02-20 23:55:10 +0000 |
---|---|---|
committer | Ingo Schwarze <schwarze@openbsd.org> | 2015-02-20 23:55:10 +0000 |
commit | 211d0cf018915b183c0683f88aacce7eed951b1f (patch) | |
tree | 7991ffd3c2b13c786e5e880958d3043769424d46 | |
parent | d5ba4ec690d23e78c49f85a785f68f1867a04ddc (diff) | |
download | mandoc-211d0cf018915b183c0683f88aacce7eed951b1f.tar.gz mandoc-211d0cf018915b183c0683f88aacce7eed951b1f.tar.zst mandoc-211d0cf018915b183c0683f88aacce7eed951b1f.zip |
For selecting a two-digit font size, support the historic syntax \s12
in addition to the classic syntax \s(12, the modern syntax \s[12],
and the alternative syntax \s'12'. The historic syntax only works
for the font sizes 10-39.
Real-world usage found by naddy@ in plan9/rc.
-rw-r--r-- | mandoc.c | 10 |
1 files changed, 9 insertions, 1 deletions
@@ -1,4 +1,4 @@ -/* $Id: mandoc.c,v 1.91 2015/01/21 20:33:25 schwarze Exp $ */ +/* $Id: mandoc.c,v 1.92 2015/02/20 23:55:10 schwarze Exp $ */ /* * Copyright (c) 2008-2011, 2014 Kristaps Dzonsons <kristaps@bsd.lv> * Copyright (c) 2011-2015 Ingo Schwarze <schwarze@openbsd.org> @@ -242,6 +242,14 @@ mandoc_escape(const char **end, const char **start, int *sz) *start = ++*end; term = '\''; break; + case '3': + /* FALLTHROUGH */ + case '2': + /* FALLTHROUGH */ + case '1': + *sz = (*end)[-1] == 's' && + isdigit((unsigned char)(*end)[1]) ? 2 : 1; + break; default: *sz = 1; break; |