bugGNU roff - Bugs: bug #64572, [man] UR, MT with no link text...

 
 

bug #64572: [man] UR, MT with no link text misrender on PDF when -rU1

Submitter:  G. Branden Robinson <gbranden>
Submitted:  Sat 19 Aug 2023 11:08:17 PM UTC
   
 
Category:  Macro package man Severity:  3 - Normal
Item Group:  Incorrect behaviour Status:  Fixed
Privacy:  Public Assigned to:  gbranden
Open/Closed:  Closed Planned Release:  1.24.0
* Mandatory Fields

Post a Comment

Add a New Comment Rich Markup
   

Discussion

Wed 23 Aug 2023 09:36:30 AM UTC, comment #4: 


commit d9e90209725a716dff23807ffffda403c58020c9
Author: G. Branden Robinson <g.branden.robinson@gmail.com>
Date:   Tue Aug 22 10:13:06 2023 -0500

    [man]: Fix Savannah #64572 (missing text on PDF).

    * tmac/an.tmac: Stop setting `an*can-hyperlink` if formatting for PDF;
      we don't yet have support for this implemented, leading to vanishing
      text when the `U` register is true and, for instance, `UR`/`UE` are
      called with no link text.

    Fixes <https://savannah.gnu.org/bugs/?64572>.


G. Branden Robinson <gbranden>
Group administrator
Tue 22 Aug 2023 03:22:03 PM UTC, comment #3: 

A simple fix restores missing text, which is the graver problem, and easy.

A better fix will get hyperlinking actually working.

But this way we don't regress relative to 1.23.0 (or 1.22.4, if the user sets the `U` register to 1).


diff --git a/ChangeLog b/ChangeLog
index 00fe1c9aa..e1cc60ce8 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,12 @@
+2023-08-22  G. Branden Robinson <g.branden.robinson@gmail.com>
+
+       * tmac/an.tmac: Stop setting `an*can-hyperlink` if formatting
+       for PDF; we don't yet have support for this implemented, leading
+       to vanishing text when the `U` register is true and, for
+       instance, `UR`/`UE` are called with no link text.
+
+       Fixes <https://savannah.gnu.org/bugs/?64572>.
+
 2023-08-21  G. Branden Robinson <g.branden.robinson@gmail.com>

        * doc/doc.am (PROCESSEDFILES_DEPS_HTML): Depend on
diff --git a/tmac/an.tmac b/tmac/an.tmac
index f614cef03..c3b1598a4 100644
--- a/tmac/an.tmac
+++ b/tmac/an.tmac
@@ -1315,7 +1315,6 @@ contains unsupported escape sequence
 .
 .nr an*can-hyperlink 0
 .if (  \n[an*is-output-html] \
-     : \n[an*is-output-pdf] \
      : \n[an*is-output-terminal]) \
 .  nr an*can-hyperlink 1
 .


G. Branden Robinson <gbranden>
Group administrator
Mon 21 Aug 2023 12:56:25 PM UTC, comment #2: 


comment #1:

> Our documentation says that -rU1 is only relevent to grotty and grohtml. The reason the text is missing is because you set an*can-hyperlink for pdf output, but there is no code to handle the pdf hyperlink in an*end-hyperlink. I think you need to add a call to:-


> .pdfhref W [-D <URI>] [-P <prefix-text>] [-A <affixed-text>] [--] descriptive text ...


> In order for the link to work, otherwise it just falls through the macro and does nothing.


Thanks, Deri.  This is super-helpful.

G. Branden Robinson <gbranden>
Group administrator
Sun 20 Aug 2023 01:56:44 PM UTC, comment #1: 

Our documentation says that -rU1 is only relevent to grotty and grohtml. The reason the text is missing is because you set an*can-hyperlink for pdf output, but there is no code to handle the pdf hyperlink in an*end-hyperlink. I think you need to add a call to:-

.pdfhref W [-D <URI>] [-P <prefix-text>] [-A <affixed-text>] [--] descriptive text ...

In order for the link to work, otherwise it just falls through the macro and does nothing.

Deri James <deri>
Group Member
Sat 19 Aug 2023 11:08:17 PM UTC, original submission:  

The bug #58950 wasn't as fixed as one would hope.

The default groff 1.23.0 configuration is okay, but if you specify -rU1 and format for PDF a man page that has a `UR`/`UE` call pair with no link text, the URL is not visible as it should be.


$ cat EXPERIMENTS/no-link-text.man
.TH foo 1 2023-08-19 "groff test suite"
.SH Name
foo \- frobnicate a bar
.SH Description
Here's a URL.
.UR http://example.com
.UE .
Report bugs to
.MT jim@example.com
.ME .
$ nroff -man EXPERIMENTS/no-link-text.man # looks OK
foo(1)                      General Commands Manual                     foo(1)

Name
       foo - frobnicate a bar

Description
       Here’s a URL.  ⟨http://example.com⟩.  Report bugs to ⟨jim@example.com⟩.

groff test suite                  2023‐08‐19                            foo(1)
$ nroff -rU1 -man EXPERIMENTS/no-link-text.man # looks OK
foo(1)                      General Commands Manual                     foo(1)

Name
       foo - frobnicate a bar

Description
       Here’s a URL.  http://example.com.  Report bugs to jim@example.com.

groff test suite                  2023‐08‐19                            foo(1)
$ groff -a -T pdf -man EXPERIMENTS/no-link-text.man # looks OK
<beginning of page>
x X ps:exec [/Dest /pdf:bm1 /View [/FitH -31000 u] /DEST pdfmark
x X ps:exec [/Dest /pdf:bm1 /Title (foo(1)) /Level 1 /OUT pdfmark
foo(1) General Commands Manual foo(1)
x X ps:exec [/Dest /pdf:bm2 /View [/FitH -67000 u] /DEST pdfmark
x X ps:exec [/Dest /pdf:bm2 /Title (Name) /Level 2 /OUT pdfmark
Name
 foo <-> frobnicate a bar
x X ps:exec [/Dest /pdf:bm3 /View [/FitH -95800 u] /DEST pdfmark
x X ps:exec [/Dest /pdf:bm3 /Title (Description) /Level 2 /OUT pdfmark
Description
 Here's a URL. <la>http://example.com<ra>. Report bugs to <la>jim@example.com<ra>.
groff test suite 2023-08-19 1


But...


$ groff -rU1 -a -T pdf -man EXPERIMENTS/no-link-text.man # BAD
<beginning of page>
x X ps:exec [/Dest /pdf:bm1 /View [/FitH -31000 u] /DEST pdfmark
x X ps:exec [/Dest /pdf:bm1 /Title (foo(1)) /Level 1 /OUT pdfmark
foo(1) General Commands Manual foo(1)
x X ps:exec [/Dest /pdf:bm2 /View [/FitH -67000 u] /DEST pdfmark
x X ps:exec [/Dest /pdf:bm2 /Title (Name) /Level 2 /OUT pdfmark
Name
 foo <-> frobnicate a bar
x X ps:exec [/Dest /pdf:bm3 /View [/FitH -95800 u] /DEST pdfmark
x X ps:exec [/Dest /pdf:bm3 /Title (Description) /Level 2 /OUT pdfmark
Description
 Here's a URL. . Report bugs to .
groff test suite 2023-08-19 1


G. Branden Robinson <gbranden>
Group administrator

 

Attached Files

This item currently has no attached files.

(Note: upload size limit is set to 16MiB, after insertion of the required escape characters.)

Attach Files:
   
   
Comment:
   

 

Dependencies

This item does not depend on any other items.

No items depend on this one.

 

Mail Notification Carbon-Copy List

Carbon-Copy List
  • -email is unavailable- added by deri (Posted a comment)
  • -email is unavailable- added by gbranden (Submitted the item)
  •  

    Votes

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

    Only logged-in users can vote.

     

    History

    Follow 7 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2023-08-23 gbranden Planned ReleaseNone 1.24.0
        StatusIn Progress Fixed
        Open/ClosedOpen Closed
    2023-08-23 gbranden Severity4 - Important 3 - Normal
    2023-08-22 gbranden Severity3 - Normal 4 - Important
        StatusNone In Progress
        Assigned toNone gbranden

    Back to the top

    Powered by Savane 3.16.
    Corresponding source code