gbranden pushed a commit to branch master
in repository groff.
commit 74c308ec475e75b117bde6676ed1e0c92fb71fc9
Author: G. Branden Robinson <[email protected]>
AuthorDate: Mon Oct 6 04:45:40 2025 -0500
[man]: Test and document TP with hyperlinked tags.
Test and document `TP` interaction with `MT`/`ME` and `UR`/`UE`.
* tmac/tests/an_MT-works.sh:
* tmac/tests/an_UR-works.sh: Add test cases for use of hyperlinks as
paragraph tags without link text.
* tmac/groff_man.7.man.in (Hyperlink macros): Document this detail of
behavior.
---
ChangeLog | 12 ++++++++++++
tmac/groff_man.7.man.in | 14 ++++++++++++--
tmac/tests/an_MT-works.sh | 21 +++++++++++++++++++--
tmac/tests/an_UR-works.sh | 14 ++++++++++++++
4 files changed, 57 insertions(+), 4 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index 57ab57fdd..0b33f8f99 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,15 @@
+2025-10-06 G. Branden Robinson <[email protected]>
+
+ [man]: Test and document `TP` interaction with `MT`/`ME` and
+ `UR`/`UE`.
+
+ * tmac/tests/an_MT-works.sh:
+ * tmac/tests/an_UR-works.sh: Add test cases for use of
+ hyperlinks as paragraph tags without link text.
+
+ * tmac/groff_man.7.man.in (Hyperlink macros): Document this
+ detail of behavior.
+
2025-10-05 Deri James <[email protected]>
[gropdf]: Update default cmap so that it works correctly
diff --git a/tmac/groff_man.7.man.in b/tmac/groff_man.7.man.in
index 47354f7f9..f722adfb1 100644
--- a/tmac/groff_man.7.man.in
+++ b/tmac/groff_man.7.man.in
@@ -1618,7 +1618,12 @@ If hyperlinking is enabled but there is no link text,
.I address
is formatted and hyperlinked
.I without
-angle brackets.
+angle brackets,
+except when
+.I address
+appears as a
+.B TP
+paragraph tag.
_ifstyle()dnl
.
.
@@ -1671,7 +1676,12 @@ If hyperlinking is enabled but there is no link text,
.I uri
is formatted and hyperlinked
.I without
-angle brackets.
+angle brackets,
+except when
+.I uri
+appears as a
+.B TP
+paragraph tag.
_ifstyle()dnl
.
.
diff --git a/tmac/tests/an_MT-works.sh b/tmac/tests/an_MT-works.sh
index 18bcea002..04716221e 100755
--- a/tmac/tests/an_MT-works.sh
+++ b/tmac/tests/an_MT-works.sh
@@ -27,7 +27,8 @@ wail() {
fail=yes
}
-input='.TH foo 1 2022-11-22 "groff test suite"
+input='.
+.TH foo 1 2022-11-22 "groff test suite"
.SH Name
foo \- frobnicate a bar
.SH Description
@@ -38,7 +39,15 @@ the boss
.
Complaints to
.MT nobody@\:example\:.com
-.ME .'
+.ME .
+.
+.
+.TP
+.MT postmaster@\:example\:.com
+.ME
+does not want them,
+either.
+.'
output=$(printf "%s\n" "$input" | "$groff" -Tascii -P-cbou -man -rU0)
echo "$output"
@@ -53,6 +62,10 @@ echo "checking formatting of mail URI with no link text" \
echo "$output" | grep -Eq 'Complaints +to +<nobody@example\.com>\.' \
|| wail
+echo "checking formatting of mail URI with no link text as paragraph" \
+ "tag (hyperlinks disabled)" >&2
+echo "$output" | grep -Fq ' <[email protected]>' || wail
+
output=$(printf "%s\n" "$input" | "$groff" -Tascii -P-cbou -man -rU1)
echo "$output"
@@ -64,6 +77,10 @@ echo "checking formatting of mail URI with no link text" \
"(hyperlinks enabled)" >&2
echo "$output" | grep -Fq 'Complaints to [email protected].' || wail
+echo "checking formatting of mail URI with no link text as paragraph" \
+ "tag (hyperlinks enabled)" >&2
+echo "$output" | grep -Fq ' [email protected]' || wail
+
input='.TH foo 1 2022-12-04 "groff test suite"
.SH Name
foo \- frobnicate a bar
diff --git a/tmac/tests/an_UR-works.sh b/tmac/tests/an_UR-works.sh
index bf43df4fb..0f87ecd11 100755
--- a/tmac/tests/an_UR-works.sh
+++ b/tmac/tests/an_UR-works.sh
@@ -46,6 +46,12 @@ figure 1
Or
.UR http://\:bar\:.example\:.com
.UE .
+.
+.
+.TP
+.UR http://\:baz\:.example\:.com
+.UE
+Frumious!
.'
output=$(printf "%s\n" "$input" | "$groff" -Tascii -P-cbou -man -rU0)
@@ -60,6 +66,10 @@ echo "checking formatting of web URI with no link text" \
"(ascii device; hyperlinks disabled)" >&2
echo "$output" | grep -Fq 'Or <http://bar.example.com>.' || wail
+echo "checking formatting of web URI with no link text as paragraph" \
+ "tag (ascii device; hyperlinks disabled)" >&2
+echo "$output" | grep -Fq ' <http://baz.example.com>' || wail
+
output=$(printf "%s\n" "$input" | "$groff" -Tascii -P-cbou -man -rU1)
echo "$output"
@@ -71,6 +81,10 @@ echo "checking formatting of web URI with no link text" \
"(ascii device; hyperlinks enabled)" >&2
echo "$output" | grep -Fq 'Or http://bar.example.com.' || wail
+echo "checking formatting of web URI with no link text as paragraph" \
+ "tag (ascii device; hyperlinks enabled)" >&2
+echo "$output" | grep -Fq ' http://baz.example.com' || wail
+
html_input='.
.TH foo 1 2022-12-04 "groff test suite"
.SH Name
_______________________________________________
groff-commit mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/groff-commit