From c61dac4b4477899e79fcb43ff7ac3ae460c8a724 Mon Sep 17 00:00:00 2001 From: Ingo Schwarze Date: Fri, 20 Feb 2015 23:55:10 +0000 Subject: 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. --- mandoc.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/mandoc.c b/mandoc.c index cd74f1a0..8ced0496 100644 --- a/mandoc.c +++ b/mandoc.c @@ -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; -- cgit