summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorIngo Schwarze <schwarze@openbsd.org>2014-10-07 14:07:03 +0000
committerIngo Schwarze <schwarze@openbsd.org>2014-10-07 14:07:03 +0000
commit847e143953798733354192e2afa9dc903f328ac3 (patch)
tree6737f495f456422d5fb30708addf6c21616a15fa
parentb6cc40bb851bdf52d1814a047df43e7f59c6d91b (diff)
downloadmandoc-847e143953798733354192e2afa9dc903f328ac3.tar.gz
If a tbl(7) layout contains unknown font modifiers, fall back to the
default font rather than failing the whole table. Needed by some pages in books/man-pages-posix. Written on the plane back from EuroBSDCon in Sofia.
-rw-r--r--mandoc.19
-rw-r--r--tbl_layout.c5
2 files changed, 12 insertions, 2 deletions
diff --git a/mandoc.1 b/mandoc.1
index 593ff91d..1cb4d93c 100644
--- a/mandoc.1
+++ b/mandoc.1
@@ -1134,11 +1134,16 @@ or
The invalid argument is moved out of the macro, which leaves the macro
empty, causing it to toggle the spacing mode.
.It Sy "unknown font, skipping request"
-.Pq man
+.Pq man , tbl
A
.Xr roff 7
.Ic \&ft
-request has an invalid argument.
+request or a
+.Xr tbl 7
+.Ic \&f
+layout modifier has an unknown
+.Ar font
+argument.
.El
.Ss "Warnings related to plain text"
.Bl -ohang
diff --git a/tbl_layout.c b/tbl_layout.c
index b0e0ae98..b78e8881 100644
--- a/tbl_layout.c
+++ b/tbl_layout.c
@@ -201,6 +201,11 @@ mod:
default:
break;
}
+ if (isalnum((unsigned char)p[*pos - 1])) {
+ mandoc_vmsg(MANDOCERR_FT_BAD, tbl->parse,
+ ln, *pos - 1, "TS f%c", p[*pos - 1]);
+ goto mod;
+ }
mandoc_msg(MANDOCERR_TBLLAYOUT, tbl->parse,
ln, *pos - 1, NULL);