summaryrefslogtreecommitdiffstats
path: root/mandoc.c
diff options
context:
space:
mode:
authorIngo Schwarze <schwarze@openbsd.org>2015-02-20 23:55:10 +0000
committerIngo Schwarze <schwarze@openbsd.org>2015-02-20 23:55:10 +0000
commitc61dac4b4477899e79fcb43ff7ac3ae460c8a724 (patch)
tree7e72e2022d898a0955a70caa916d802ccf261674 /mandoc.c
parentb6009097ae3ad6c24b2fbc8e50140a6bbb5986cd (diff)
downloadmandoc-c61dac4b4477899e79fcb43ff7ac3ae460c8a724.tar.gz
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.
Diffstat (limited to 'mandoc.c')
-rw-r--r--mandoc.c8
1 files changed, 8 insertions, 0 deletions
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;