[BACK]Return to column.in CVS log [TXT][DIR] Up to [cvsweb.bsd.lv] / mandoc / regress / mdoc / Bl

File: [cvsweb.bsd.lv] / mandoc / regress / mdoc / Bl / column.in (download)

Revision 1.4, Thu Jul 11 17:06:18 2019 UTC (4 years, 11 months ago) by schwarze
Branch: MAIN
CVS Tags: VERSION_1_14_6, HEAD
Changes since 1.3: +4 -3 lines

When parsing a tab character that is not preceded by a space character
on an .It -column line, args() sets the MDOC_PHRASEQL flag to Quote
the Last word of the Phrase.  Even if it turns out this quoting is not
needed because the word is already quoted for other reasons, clear the
flag at the end of parsing the phrase, such that the flag does not leak
to the next phrase.

This patch fixes the bug that the trailing Macro on a line of the form
.It "word<tab>word" Ta word Macro<eol>
was incorrectly considered quoted and hence not parsed.

Bug found by Havard Eidnes (he@) with the NetBSD gettytab(5) manual page:
https://gnats.netbsd.org/cgi-bin/query-pr-single.pl?number=54361
Reported via Thomas Klausner (wiz@).

.\" $OpenBSD: column.in,v 1.11 2019/07/11 16:56:52 schwarze Exp $
.Dd $Mdocdate: July 11 2019 $
.Dt BL-COLUMN 1
.Os
.Sh NAME
.Nm Bl-column
.Nd lists with multiple columns
.Sh DESCRIPTION
.Bl -column "a"
.It a
.El
.Bl -column "a" "b"
.It a Ta b
.El
.\" avoid "c" which means "cm"
.Bl -column "a" "b" "cc"
.It a Ta b Ta cc
.It a	b	cc
.It "a"	b	cc
.It "a	b"	cc
.It "a	b	cc"
.El
.Bl -column "a" "b" "cc" "d"
.It a Ta b Ta cc Ta d
.El
.Bl -column "a" "b" "cc" "d" "e"
.It a Ta b Ta cc Ta d Ta e
.El
.\" Probing up to the utter limits of groff.
.\" With more than 5 columns or more than 78 characters per line,
.\" groff .Bl -column turns completely mad.
.\" mandoc can do more, but it's no use testing that.
.Bd -literal
5 + 35 + 4 + 34 = 78:
.Ed
.Bl -column "x35xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"  "x34xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
.It          x35xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx Ta x34xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
.It a Ta b
.El
.Bd -literal
5 + (22+4)*2 + 21 = 78:
.Ed
.Bl -column "x22xxxxxxxxxxxxxxxxxxx"  "x22xxxxxxxxxxxxxxxxxxx"  "x21xxxxxxxxxxxxxxxxxx"
.It          x22xxxxxxxxxxxxxxxxxxx Ta x22xxxxxxxxxxxxxxxxxxx Ta x21xxxxxxxxxxxxxxxxxx
.It a Ta b Ta c
.El
.Bd -literal
5 + 16 + (4+15)*3 = 78:
.Ed
.Bl -column "x16xxxxxxxxxxxxx"  "x15xxxxxxxxxxxx"  "x15xxxxxxxxxxxx"  "x15xxxxxxxxxxxx"
.It          x16xxxxxxxxxxxxx Ta x15xxxxxxxxxxxx Ta x15xxxxxxxxxxxx Ta x15xxxxxxxxxxxx
.It a Ta b Ta c Ta d
.El
.Bd -literal
5 + 13 + (3+12)*4 = 78:
.Ed
.Bl -column "x13xxxxxxxxxx"  "x12xxxxxxxxx"  "x12xxxxxxxxx"  "x12xxxxxxxxx"  "x12xxxxxxxxx"
.It          x13xxxxxxxxxx Ta x12xxxxxxxxx Ta x12xxxxxxxxx Ta x12xxxxxxxxx Ta x12xxxxxxxxx
.It a Ta b Ta c Ta d Ta e
.El
.\" Trailing white space in phrases.
.Bl -column "aaaa" "bbbb"
.It "a" Ta "b"
.It "a " Ta "b"
.It "a  " Ta "b"
.It a	b
.It a 	b
.It a  	b
.El
.\" Wrong number of columns.
.Bl -column "a" "b"
.It
.It "a"
.It "a" Ta "b"
.It
.It "a" Ta "b" Ta "c"
.It "a" Ta "b" Ta "c" Ta "d"
.It "a" Ta "b" Ta "c" Ta "d" Ta "e"
.It
.El
.\" Mixed tab and Ta
.Bl -column a b c d
.It a	b	c	d
.It "a	b	c" Ta
d
.It a	b Ta c	d
.It a	b Ta c Ta d
.It a Ta b	c	d
.It a Ta b	c Ta d
.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
.El