diff options
author | Ingo Schwarze <schwarze@openbsd.org> | 2018-12-16 00:17:02 +0000 |
---|---|---|
committer | Ingo Schwarze <schwarze@openbsd.org> | 2018-12-16 00:17:02 +0000 |
commit | fb7ea55796176565141285c5c6de1d3127655116 (patch) | |
tree | 63b21db96671f3ca27e3f0658ae34a5d8babc63d /roff_validate.c | |
parent | d672f8cb82878baf3834e938c4c416f4493952cf (diff) | |
download | mandoc-fb7ea55796176565141285c5c6de1d3127655116.tar.gz mandoc-fb7ea55796176565141285c5c6de1d3127655116.tar.zst mandoc-fb7ea55796176565141285c5c6de1d3127655116.zip |
Yet another round of improvements to manual font selection.
Unify handling of \f and .ft.
Support \f4 (bold+italic).
Support ".ft BI" and ".ft CW" for terminal output.
Support the .ft request in HTML output.
Reject the bogus fonts \f(C1, \f(C2, \f(C3, and \f(CP.
In regress.pl, only strip leading whitespace in math mode.
Diffstat (limited to 'roff_validate.c')
-rw-r--r-- | roff_validate.c | 28 |
1 files changed, 3 insertions, 25 deletions
diff --git a/roff_validate.c b/roff_validate.c index 5593dd8a..d4cf6f6b 100644 --- a/roff_validate.c +++ b/roff_validate.c @@ -1,4 +1,4 @@ -/* $Id: roff_validate.c,v 1.14 2018/12/14 05:18:03 schwarze Exp $ */ +/* $Id: roff_validate.c,v 1.15 2018/12/16 00:17:02 schwarze Exp $ */ /* * Copyright (c) 2010, 2017, 2018 Ingo Schwarze <schwarze@openbsd.org> * @@ -104,30 +104,8 @@ roff_valid_ft(ROFF_VALID_ARGS) } cp = n->child->string; - switch (*cp) { - case '1': - case '2': - case '3': - case '4': - case 'I': - case 'P': - case 'R': - if (cp[1] == '\0') - return; - break; - case 'B': - if (cp[1] == '\0' || (cp[1] == 'I' && cp[2] == '\0')) - return; - break; - case 'C': - if (cp[1] != '\0' && cp[2] == '\0' && - strchr("BIRW", cp[1]) != NULL) - return; - break; - default: - break; - } - + if (mandoc_font(cp, (int)strlen(cp)) != ESCAPE_ERROR) + return; mandoc_msg(MANDOCERR_FT_BAD, n->line, n->pos, "ft %s", cp); roff_node_delete(man, n); } |