and some groff manual pages actually use them in .ft requests.
It's easy enough to handle these .ft requests in mandoc, too.
-.\" $OpenBSD: roff.7,v 1.77 2018/08/10 04:41:21 schwarze Exp $
+.\" $OpenBSD: roff.7,v 1.78 2018/08/10 20:40:43 schwarze Exp $
.\"
.\" Copyright (c) 2010, 2011, 2012 Kristaps Dzonsons <kristaps@bsd.lv>
.\" Copyright (c) 2010-2018 Ingo Schwarze <schwarze@openbsd.org>
.Ar font
arguments are supported:
.Bl -tag -width 4n -offset indent
-.It Cm B , BI , 3 , 4
+.It Cm B , BI , CB , 3 , 4
switches to
.Sy bold
font
-.It Cm I , 2
+.It Cm I , CI , 2
switches to
.Em underlined
font
-.It Cm R , CW , 1
+.It Cm R , CR , CW , 1
switches to normal font
.It Cm P No "or no argument"
switches back to the previous font
-/* $OpenBSD: roff_term.c,v 1.14 2017/06/24 14:38:28 schwarze Exp $ */
+/* $OpenBSD: roff_term.c,v 1.15 2018/08/10 20:40:43 schwarze Exp $ */
/*
- * Copyright (c) 2010, 2014, 2015, 2017 Ingo Schwarze <schwarze@openbsd.org>
+ * Copyright (c) 2010,2014,2015,2017,2018 Ingo Schwarze <schwarze@openbsd.org>
*
* Permission to use, copy, modify, and distribute this software for any
* purpose with or without fee is hereby granted, provided that the above
static void
roff_term_pre_ft(ROFF_TERM_ARGS)
{
- switch (*n->child->string) {
+ const char *cp;
+
+ if (*(cp = n->child->string) == 'C')
+ cp++;
+
+ switch (*cp) {
case '4':
case '3':
case 'B':
-/* $OpenBSD: roff_validate.c,v 1.9 2017/06/14 22:50:37 schwarze Exp $ */
+/* $OpenBSD: roff_validate.c,v 1.10 2018/08/10 20:40:43 schwarze Exp $ */
/*
- * Copyright (c) 2010, 2017 Ingo Schwarze <schwarze@openbsd.org>
+ * Copyright (c) 2010, 2017, 2018 Ingo Schwarze <schwarze@openbsd.org>
*
* Permission to use, copy, modify, and distribute this software for any
* purpose with or without fee is hereby granted, provided that the above
#include <assert.h>
#include <stddef.h>
+#include <string.h>
#include "mandoc.h"
#include "roff.h"
static void
roff_valid_ft(ROFF_VALID_ARGS)
{
- char *cp;
+ const char *cp;
if (n->child == NULL) {
man->next = ROFF_NEXT_CHILD;
return;
break;
case 'C':
- if (cp[1] == 'W' && cp[2] == '\0')
+ if (cp[1] != '\0' && cp[2] == '\0' &&
+ strchr("BIRW", cp[1]) != NULL)
return;
break;
default: