summaryrefslogtreecommitdiffstats
path: root/regress
diff options
context:
space:
mode:
authorIngo Schwarze <schwarze@openbsd.org>2021-08-10 12:55:03 +0000
committerIngo Schwarze <schwarze@openbsd.org>2021-08-10 12:55:03 +0000
commiteaf84848c463416967ecacc10a55630fcf7f115c (patch)
tree117ec40c599172a6a7bff36a9975014afe37425f /regress
parent87aab9cae5c14191a96f9f17bd2723fe998eb2be (diff)
downloadmandoc-eaf84848c463416967ecacc10a55630fcf7f115c.tar.gz
Support two-character font names (BI, CW, CR, CB, CI)
in the tbl(7) layout font modifier. Get rid of the TBL_CELL_BOLD and TBL_CELL_ITALIC flags and use the usual ESCAPE_FONT* enum mandoc_esc members from mandoc.h instead, which simplifies and unifies some code. While here, also support CB and CI in roff(7) \f escape sequences and in roff(7) .ft requests for all output modes. Using those is certainly not recommended because portability is limited even with groff, but supporting them makes some existing third-party manual pages look better, in particular in HTML output mode. Bug-compatible with groff as far as i'm aware, except that i consider font names starting with the '\n' (ASCII 0x0a line feed) character so insane that i decided to not support them. Missing feature reported by nabijaczleweli dot xyz in https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=992002. I used none of the code from the initial patch submitted by nabijaczleweli, but some of their ideas. Final patch tested by them, too.
Diffstat (limited to 'regress')
-rw-r--r--regress/roff/esc/f.out_html2
-rw-r--r--regress/roff/ft/badargs.out_html7
-rw-r--r--regress/tbl/mod/Makefile11
-rw-r--r--regress/tbl/mod/badfont.in12
-rw-r--r--regress/tbl/mod/badfont.out_ascii13
-rw-r--r--regress/tbl/mod/badfont.out_lint5
-rw-r--r--regress/tbl/mod/font-eol.in13
-rw-r--r--regress/tbl/mod/font-eol.out_ascii13
-rw-r--r--regress/tbl/mod/font-eol.out_lint1
-rw-r--r--regress/tbl/mod/font.out_lint1
10 files changed, 55 insertions, 23 deletions
diff --git a/regress/roff/esc/f.out_html b/regress/roff/esc/f.out_html
index 887175f6..30f5c7e1 100644
--- a/regress/roff/esc/f.out_html
+++ b/regress/roff/esc/f.out_html
@@ -1,4 +1,4 @@
numbers: <b><i>bolditalic</i></b><b>bold</b><i>italic</i>roman
letters: <b>bold</b><i>italic</i><b>back</b><b><i>bolditalic</i></b>roman
multiletter: <b>bold</b>empty<i>italic</i>back<b><i>bolditalic</i></b>roman
-typewriter: <span class="Li">roman</span><b>bold</b><span class="Li">roman</span><i>italic</i>roman
+typewriter: <span class="Li">roman</span><span class="Li"><b>bold</b></span><span class="Li">roman</span><span class="Li"><i>italic</i></span>roman
diff --git a/regress/roff/ft/badargs.out_html b/regress/roff/ft/badargs.out_html
index a332e3a2..686ca476 100644
--- a/regress/roff/ft/badargs.out_html
+++ b/regress/roff/ft/badargs.out_html
@@ -1,6 +1,7 @@
<br/>
default font <i>italic</i> <b><i>bold italic</i></b>
- <span class="Li">typeqriter</span> <span class="Li">roman</span> <b>bold</b>
- <i>italic</i> <b>bold</b> <b>still bold</b> <i>italic</i> <i>back to
- bold</i> <i>back to italic</i>
+ <span class="Li">typeqriter</span> <span class="Li">roman</span>
+ <span class="Li"><b>bold</b></span> <span class="Li"><i>italic</i></span>
+ <b>bold</b> <b>still bold</b> <i>italic</i> <i>back to bold</i> <i>back to
+ italic</i>
<br/>
diff --git a/regress/tbl/mod/Makefile b/regress/tbl/mod/Makefile
index 96547d64..7bbf30e5 100644
--- a/regress/tbl/mod/Makefile
+++ b/regress/tbl/mod/Makefile
@@ -1,15 +1,16 @@
-# $OpenBSD: Makefile,v 1.2 2015/02/10 11:02:19 schwarze Exp $
+# $OpenBSD: Makefile,v 1.6 2021/08/10 12:36:42 schwarze Exp $
-REGRESS_TARGETS = badfont expand expand-toowide font misalign spacing width
-LINT_TARGETS = badfont font
+REGRESS_TARGETS = badfont expand expand-toowide font font-eol
+REGRESS_TARGETS += misalign spacing width
+LINT_TARGETS = badfont font font-eol
-# groff-1.22.3 defects:
+# groff-1.22.4 defects:
# - The "f" font modifier swallows a following newline character.
# - When space is insufficient (on either side) for properly aligning
# a number, GNU tbl(1) moves the number too much to the right,
# overflowing the column, even if space would be sufficient without
# left padding.
-SKIP_GROFF = badfont misalign
+SKIP_GROFF = font-eol misalign
.include <bsd.regress.mk>
diff --git a/regress/tbl/mod/badfont.in b/regress/tbl/mod/badfont.in
index 2a4f0d0a..12303149 100644
--- a/regress/tbl/mod/badfont.in
+++ b/regress/tbl/mod/badfont.in
@@ -1,15 +1,17 @@
-.\" $OpenBSD: badfont.in,v 1.2 2017/07/04 14:53:27 schwarze Exp $
-.TH TBL-MOD-BADFONT 1 "February 10, 2015"
+.\" $OpenBSD: badfont.in,v 1.3 2021/08/10 12:36:42 schwarze Exp $
+.TH TBL-MOD-BADFONT 1 "August 9, 2021"
.SH NAME
tbl-mod-badfont \- invalid font modifiers in table layouts
.SH DESCRIPTION
normal text
.TS
box tab(:);
-lfB lf
+lfI lfX
+lfB lfIB
lfI lf.
lfB lfI.
-bold:none
-italic:none
+italic:one char
+bold:two chars
+italic:dot
bold:italic
.TE
diff --git a/regress/tbl/mod/badfont.out_ascii b/regress/tbl/mod/badfont.out_ascii
index 43683330..4cd3bd3f 100644
--- a/regress/tbl/mod/badfont.out_ascii
+++ b/regress/tbl/mod/badfont.out_ascii
@@ -6,9 +6,10 @@ NNAAMMEE
DDEESSCCRRIIPPTTIIOONN
normal text
- +----------------+
- |bboolldd none |
- |_i_t_a_l_i_c none |
- |bboolldd _i_t_a_l_i_c |
- +----------------+
-OpenBSD February 10, 2015 TBL-MOD-BADFONT(1)
+ +-------------------+
+ |_i_t_a_l_i_c one char |
+ |bboolldd two chars |
+ |_i_t_a_l_i_c dot |
+ |bboolldd _i_t_a_l_i_c |
+ +-------------------+
+OpenBSD August 9, 2021 TBL-MOD-BADFONT(1)
diff --git a/regress/tbl/mod/badfont.out_lint b/regress/tbl/mod/badfont.out_lint
index c19bae82..7884ec88 100644
--- a/regress/tbl/mod/badfont.out_lint
+++ b/regress/tbl/mod/badfont.out_lint
@@ -1,2 +1,3 @@
-mandoc: badfont.in:9:7: WARNING: unknown font, skipping request: TS f
-mandoc: badfont.in:10:7: WARNING: unknown font, skipping request: TS f.
+mandoc: badfont.in:9:7: WARNING: unknown font, skipping request: TS fX
+mandoc: badfont.in:10:7: WARNING: unknown font, skipping request: TS fIB
+mandoc: badfont.in:11:7: WARNING: unknown font, skipping request: TS f.
diff --git a/regress/tbl/mod/font-eol.in b/regress/tbl/mod/font-eol.in
new file mode 100644
index 00000000..fadf66ec
--- /dev/null
+++ b/regress/tbl/mod/font-eol.in
@@ -0,0 +1,13 @@
+.\" $OpenBSD: font-eol.in,v 1.1 2021/08/10 12:36:42 schwarze Exp $
+.TH TBL-MOD-FONT-EOL 1 "August 9, 2021"
+.SH NAME
+tbl-mod-font-eol \- font modifier at eol in table layout
+.SH DESCRIPTION
+normal text
+.TS
+box tab(:);
+lfB lf
+lfB lfI.
+bold:none
+bold:italic
+.TE
diff --git a/regress/tbl/mod/font-eol.out_ascii b/regress/tbl/mod/font-eol.out_ascii
new file mode 100644
index 00000000..c87d5aba
--- /dev/null
+++ b/regress/tbl/mod/font-eol.out_ascii
@@ -0,0 +1,13 @@
+TBL-MOD-FONT-EOL(1) General Commands Manual TBL-MOD-FONT-EOL(1)
+
+NNAAMMEE
+ tbl-mod-font-eol - font modifier at eol in table layout
+
+DDEESSCCRRIIPPTTIIOONN
+ normal text
+
+ +--------------+
+ |bboolldd none |
+ |bboolldd _i_t_a_l_i_c |
+ +--------------+
+OpenBSD August 9, 2021 TBL-MOD-FONT-EOL(1)
diff --git a/regress/tbl/mod/font-eol.out_lint b/regress/tbl/mod/font-eol.out_lint
new file mode 100644
index 00000000..c7f83f34
--- /dev/null
+++ b/regress/tbl/mod/font-eol.out_lint
@@ -0,0 +1 @@
+mandoc: font-eol.in:9:7: WARNING: unknown font, skipping request: TS f
diff --git a/regress/tbl/mod/font.out_lint b/regress/tbl/mod/font.out_lint
index 06046a43..7ddd6280 100644
--- a/regress/tbl/mod/font.out_lint
+++ b/regress/tbl/mod/font.out_lint
@@ -1,4 +1,3 @@
-mandoc: font.in:9:6: WARNING: unknown font, skipping request: TS fCW|ci
mandoc: font.in:19:2: WARNING: tab in filled text
mandoc: font.in:19:4: WARNING: tab in filled text
mandoc: font.in:19:6: WARNING: tab in filled text