summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKristaps Dzonsons <kristaps@bsd.lv>2011-09-03 00:29:21 +0000
committerKristaps Dzonsons <kristaps@bsd.lv>2011-09-03 00:29:21 +0000
commitb9398370b0006ab2c539b0093cee758dfa1566fa (patch)
tree1f9c7923a17d47ba0250f5c8c6d001232185c9a1
parent2f337575f0b60b2f7fa3a87d67b27e01f8c40c0d (diff)
downloadmandoc-b9398370b0006ab2c539b0093cee758dfa1566fa.tar.gz
Fix handling of font modifiers in tables. Noted by Brad Smith.
-rw-r--r--tbl.715
-rw-r--r--tbl_layout.c10
2 files changed, 22 insertions, 3 deletions
diff --git a/tbl.7 b/tbl.7
index 561ca4db..2efb90fa 100644
--- a/tbl.7
+++ b/tbl.7
@@ -256,12 +256,21 @@ The following case-insensitive modifier keys are available:
.Cm e ,
.Cm t ,
.Cm d ,
-.Cm f ,
.Cm b ,
.Cm i ,
-.Cm b ,
+.Cm r ,
and
-.Cm i .
+.Cm f
+.Po
+followed by
+.Cm b ,
+.Cm i ,
+.Cm r ,
+.Cm 3 ,
+.Cm 2 ,
+or
+.Cm 1
+.Pc .
All of these are ignored by
.Xr mandoc 1 .
.Pp
diff --git a/tbl_layout.c b/tbl_layout.c
index b6f45f43..07837f9b 100644
--- a/tbl_layout.c
+++ b/tbl_layout.c
@@ -173,6 +173,8 @@ mod:
goto mod;
case ('f'):
break;
+ case ('r'):
+ /* FALLTHROUGH */
case ('b'):
/* FALLTHROUGH */
case ('i'):
@@ -185,12 +187,20 @@ mod:
}
switch (tolower((unsigned char)p[(*pos)++])) {
+ case ('3'):
+ /* FALLTHROUGH */
case ('b'):
cp->flags |= TBL_CELL_BOLD;
goto mod;
+ case ('2'):
+ /* FALLTHROUGH */
case ('i'):
cp->flags |= TBL_CELL_ITALIC;
goto mod;
+ case ('1'):
+ /* FALLTHROUGH */
+ case ('r'):
+ goto mod;
default:
break;
}