aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/mandoc.c
diff options
context:
space:
mode:
authorIngo Schwarze <schwarze@openbsd.org>2013-08-08 20:07:47 +0000
committerIngo Schwarze <schwarze@openbsd.org>2013-08-08 20:07:47 +0000
commitcbcd971bbd4927814d654460337a6774684b3d8f (patch)
treea16bde046faa01e1fc65164f1b20f8dc356001d7 /mandoc.c
parentb9c9c79db57653ef779df3251313389a9fe378ec (diff)
downloadmandoc-cbcd971bbd4927814d654460337a6774684b3d8f.tar.gz
mandoc-cbcd971bbd4927814d654460337a6774684b3d8f.tar.zst
mandoc-cbcd971bbd4927814d654460337a6774684b3d8f.zip
Implement the roff(7) font-escape sequence \f(BI "bold+italic".
This improves the formatting of about 40 base manuals and reduces groff-mandoc formatting differences in base by about 5%.
Diffstat (limited to 'mandoc.c')
-rw-r--r--mandoc.c24
1 files changed, 15 insertions, 9 deletions
diff --git a/mandoc.c b/mandoc.c
index 274b7163..df510226 100644
--- a/mandoc.c
+++ b/mandoc.c
@@ -1,7 +1,7 @@
-/* $Id: mandoc.c,v 1.67 2013/06/20 22:39:30 schwarze Exp $ */
+/* $Id: mandoc.c,v 1.68 2013/08/08 20:07:47 schwarze Exp $ */
/*
* Copyright (c) 2008, 2009, 2010, 2011 Kristaps Dzonsons <kristaps@bsd.lv>
- * Copyright (c) 2011, 2012 Ingo Schwarze <schwarze@openbsd.org>
+ * Copyright (c) 2011, 2012, 2013 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
@@ -296,13 +296,19 @@ mandoc_escape(const char **end, const char **start, int *sz)
switch (gly) {
case (ESCAPE_FONT):
- /*
- * Pretend that the constant-width font modes are the
- * same as the regular font modes.
- */
- if (2 == *sz && 'C' == **start) {
- (*start)++;
- (*sz)--;
+ if (2 == *sz) {
+ if ('C' == **start) {
+ /*
+ * Treat constant-width font modes
+ * just like regular font modes.
+ */
+ (*start)++;
+ (*sz)--;
+ } else {
+ if ('B' == (*start)[0] && 'I' == (*start)[1])
+ gly = ESCAPE_FONTBI;
+ break;
+ }
} else if (1 != *sz)
break;