From 211d0cf018915b183c0683f88aacce7eed951b1f 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 | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'mandoc.c') diff --git a/mandoc.c b/mandoc.c index a61d2331..0619420c 100644 --- a/mandoc.c +++ b/mandoc.c @@ -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 * Copyright (c) 2011-2015 Ingo Schwarze @@ -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 v1.2.3-56-ge451