summaryrefslogtreecommitdiff
path: root/regress/usr.bin/mandoc/mdoc/Bl
diff options
context:
space:
mode:
authorIngo Schwarze <schwarze@cvs.openbsd.org>2015-10-17 00:19:59 +0000
committerIngo Schwarze <schwarze@cvs.openbsd.org>2015-10-17 00:19:59 +0000
commitde70a04fb79358b9ca8589c5eed818e499d91cd6 (patch)
tree009e464332d7706d96ce9822720d6e5bab5fc3e1 /regress/usr.bin/mandoc/mdoc/Bl
parent2b30cac8bf7ca0ed0d5af0bb3f214f7f7565f88f (diff)
Very tricky diff to fix macro interpretation and spacing around tabs
in .Bl -column; it took me more than a day to get this right. Triggered by a loosely related bug report from tim@. The lesson for you is: Use .Ta macros in .Bl -column, avoid tabs, or you are in for surprises: The last word before a tab is not interpreted as a macro (unless there is a blank in between), the first word after a tab isn't either (unless there is a blank in between), and a blank after a tab causes a leading blank in the respective output cell. Yes, "blank", "tab", "blank tab" and "tab blank" all have different semantics; if you write code relying on that, good luck maintaining it afterwards...
Diffstat (limited to 'regress/usr.bin/mandoc/mdoc/Bl')
-rw-r--r--regress/usr.bin/mandoc/mdoc/Bl/column.in14
-rw-r--r--regress/usr.bin/mandoc/mdoc/Bl/column.out_ascii10
-rw-r--r--regress/usr.bin/mandoc/mdoc/Bl/column.out_lint2
3 files changed, 25 insertions, 1 deletions
diff --git a/regress/usr.bin/mandoc/mdoc/Bl/column.in b/regress/usr.bin/mandoc/mdoc/Bl/column.in
index d959612bdeb..be6ccdca9d7 100644
--- a/regress/usr.bin/mandoc/mdoc/Bl/column.in
+++ b/regress/usr.bin/mandoc/mdoc/Bl/column.in
@@ -85,6 +85,20 @@
.It a Ta b Ta c d
.It a Ta b Ta c Ta d
.El
+.\" Macros before and after tabs
+.Bl -column "aa" "OpenBSD OpenBSD OpenBSD"
+.It aa Ta Ox Ox Ox Ta tab-tab
+.It aa Ta Ox Ox Ox tab-ta
+.It aa Ox Ox Ox Ta ta-tab
+.It aa Ox Ox Ox ta-ta
+.It aa Ox Ox Ox ta-bl/ta
+.It aa Ox Ox Ox ta/bl-ta
+.It aa Ox Ox Ox ta/bl-bl/ta
+.It aa Ta bb Ta
+ta at eol
+.It aa bb
+tab at eol
+.El
.\" Interrupted column list
.Bl -column "aa" -width 6n -compact "bb" "cc"
.It aa Ta bb Ta cc Ta dd
diff --git a/regress/usr.bin/mandoc/mdoc/Bl/column.out_ascii b/regress/usr.bin/mandoc/mdoc/Bl/column.out_ascii
index 7cbce2e95e3..a7c07d32b22 100644
--- a/regress/usr.bin/mandoc/mdoc/Bl/column.out_ascii
+++ b/regress/usr.bin/mandoc/mdoc/Bl/column.out_ascii
@@ -59,6 +59,16 @@ DDEESSCCRRIIPPTTIIOONN
a b c d
a b c d
a b c d
+
+ aa OpenBSD OpenBSD OpenBSD tab-tab
+ aa OpenBSD OpenBSD Ox tab-ta
+ aa Ox OpenBSD OpenBSD ta-tab
+ aa Ox OpenBSD Ox ta-ta
+ aa Ox OpenBSD OpenBSD ta-bl/ta
+ aa OpenBSD OpenBSD Ox ta/bl-ta
+ aa OpenBSD OpenBSD OpenBSD ta/bl-bl/ta
+ aa bb ta at eol
+ aa bb tab at eol
aa bb cc dd
OpenBSD October 14, 2015 OpenBSD
diff --git a/regress/usr.bin/mandoc/mdoc/Bl/column.out_lint b/regress/usr.bin/mandoc/mdoc/Bl/column.out_lint
index 1cadbff8cfe..eed080bdc7f 100644
--- a/regress/usr.bin/mandoc/mdoc/Bl/column.out_lint
+++ b/regress/usr.bin/mandoc/mdoc/Bl/column.out_lint
@@ -1,4 +1,4 @@
mandoc: column.in:71:2: WARNING: wrong number of cells: 2 columns, 1 cells
mandoc: column.in:74:2: WARNING: wrong number of cells: 2 columns, 4 cells
mandoc: column.in:75:2: WARNING: wrong number of cells: 2 columns, 5 cells
-mandoc: column.in:89:18: WARNING: skipping -width argument: Bl -column
+mandoc: column.in:103:18: WARNING: skipping -width argument: Bl -column