diff options
author | Ingo Schwarze <schwarze@openbsd.org> | 2013-08-08 20:07:47 +0000 |
---|---|---|
committer | Ingo Schwarze <schwarze@openbsd.org> | 2013-08-08 20:07:47 +0000 |
commit | 35783c93c6366fa20e6ed5149c9c25091d01a222 (patch) | |
tree | 4266ad56af17b4c240366f90f69b31b3faa383b4 /mandoc.c | |
parent | 20b1a5ef7f370e238b774d0fb38b8cb6bedae40f (diff) | |
download | mandoc-35783c93c6366fa20e6ed5149c9c25091d01a222.tar.gz |
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.c | 22 |
1 files changed, 14 insertions, 8 deletions
@@ -1,7 +1,7 @@ /* $Id$ */ /* * 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; |