groff-commit
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[groff] 05/16: [man]: Fix Savannah #65464.


From: G. Branden Robinson
Subject: [groff] 05/16: [man]: Fix Savannah #65464.
Date: Sat, 16 Mar 2024 01:48:51 -0400 (EDT)

gbranden pushed a commit to branch master
in repository groff.

commit dbe9fc435a2aa64e937c85c1bd06e97e11ae2e19
Author: G. Branden Robinson <g.branden.robinson@gmail.com>
AuthorDate: Fri Mar 15 22:01:55 2024 -0500

    [man]: Fix Savannah #65464.
    
    * tmac/an.tmac (an*end-hyperlink): Unformat the diversion before
      emitting it.  This way adjustment of spaces will take place in the
      context where it's actually formatted, and be more appropriate to the
      line.
    
    * tmac/tests/an_adjust-link-text-correctly.sh: Update test expectations.
      The only change here was to adjustment parity.
    
    Fixes <https://savannah.gnu.org/bugs/?65464>.
---
 ChangeLog                                   | 14 ++++++++++++++
 tmac/an.tmac                                |  1 +
 tmac/tests/an_adjust-link-text-correctly.sh | 12 ++++++++++--
 3 files changed, 25 insertions(+), 2 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 450d2bffa..26617dda2 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,17 @@
+2024-03-15  G. Branden Robinson <g.branden.robinson@gmail.com>
+
+       [man]: Fix Savannah #65464.
+
+       * tmac/an.tmac (an*end-hyperlink): Unformat the diversion before
+       emitting it.  This way adjustment of spaces will take place in
+       the context where it's actually formatted, and be more
+       appropriate to the line.
+
+       * tmac/tests/an_adjust-link-text-correctly.sh: Update test
+       expectations.  The only change here was to adjustment parity.
+
+       Fixes <https://savannah.gnu.org/bugs/?65464>.
+
 2024-03-15  G. Branden Robinson <g.branden.robinson@gmail.com>
 
        [man]: Fix Savannah #65462.
diff --git a/tmac/an.tmac b/tmac/an.tmac
index b4710e23a..c5b2ed256 100644
--- a/tmac/an.tmac
+++ b/tmac/an.tmac
@@ -1176,6 +1176,7 @@ contains unsupported escape sequence
 .        pdfhref W -D \\*[an*hyperlink] -- |
 .      if \\n[an*is-output-terminal] \
 .        nop \X'tty: link \\*[an*hyperlink]'\c
+.      unformat an*link-text \" ...so it adjusts in its new context.
 .      \" Replace the final newline of the diversion.
 .      chop an*link-text
 .      as an*link-text \&\c
diff --git a/tmac/tests/an_adjust-link-text-correctly.sh 
b/tmac/tests/an_adjust-link-text-correctly.sh
index e1cb1c77c..ef22b0886 100755
--- a/tmac/tests/an_adjust-link-text-correctly.sh
+++ b/tmac/tests/an_adjust-link-text-correctly.sh
@@ -43,10 +43,14 @@ input='.TH foo 1 2022-11-08 "groff test suite"
 .I Part I
 .UE'
 
+# Expected:
+#   PCL 5XX Printer Language Technical Reference  Manual,
+
 echo "checking formatting of whole-line link text" >&2
 output=$(printf "%s\n" "$input" | "$groff" -Tascii -P-cbou -man -rU1)
 echo "$output"
-echo "$output" | grep -q 'HP  PCL/PJL Reference: PCL 5XX.*,$' || wail
+echo "$output" \
+    | grep -q 'Printer Language Technical Reference  Manual,$' || wail
 
 input='.TH foo 1 2022-11-08 "groff test suite"
 .SH "See also"
@@ -58,11 +62,15 @@ Consult
 .I Part I
 .UE .'
 
+# Expected:
+#   PCL 5 Printer  Language  Technical  Reference
+
 echo "checking formatting of partial-line link text" >&2
 output=$(printf "%s\n" "$input" | "$groff" -Tascii -P-cbou -man -rU1)
 echo "$output"
 # 2 spaces each
-echo "$output" | grep -q 'Consult HP  PCL/PJL  Reference:  PCL' || wail
+echo "$output" \
+    | grep -q 'Printer  Language  Technical  Reference$' || wail
 
 test -z "$fail"
 



reply via email to

[Prev in Thread] Current Thread [Next in Thread]