#1018965 groff -man -Thtml: malformed table for .IP + .UR

Package:
groff
Source:
groff
Description:
GNU troff text-formatting system
Submitter:
Jakub Wilk
Date:
2023-07-22 01:15:02 UTC
Severity:
normal
Tags:
#1018965#3
Date:
2022-09-02 18:13:03 UTC
From:
To:
Consider the following man page source:

   $ cat IP-UR.man
   .TH
   .IP 1. 4
   .UR https://bar.example
   .UE

For this file, "groff -man -Thtml" produces a malformed table:

   $ groff -man -Thtml IP-UR.man | grep . | grep example -B2
   <td width="3%">
   <p>1.</p></td>
   <td width="3%"></td>
   <p><a href="https://bar.example">https://bar.example</a></p> </td>

Note that the paragraph containing the link is not inside any <td>.
As a consequence, browsers render the link in the wrong place.

(Ideas for work-arounds are welcome.)

#1018965#8
Date:
2022-09-28 07:09:07 UTC
From:
To:
package groff
tag 1018965 + upstream
thanks

Hi Jakub,

I work on groff upstream.

The problem appears to be that your link text is empty.  I was able to
achieve correct layout with the following change to your reproducer.

$ diff -u EXPERIMENTS/IP-UR.man EXPERIMENTS/IP-UR-GBR.man
--- EXPERIMENTS/IP-UR.man       2022-09-28 02:01:54.016037398 -0500
+++ EXPERIMENTS/IP-UR-GBR.man   2022-09-28 02:01:58.628015422 -0500
@@ -1,4 +1,5 @@
 .TH
 .IP 1. 4
 .UR https://bar.example
+linky link
 .UE

I'll see if I can make the package reuse the URL as the link text when
there is no link text.  A similar problem likely affects MT/ME.

Regards,
Branden

#1018965#11
Date:
2023-01-04 15:17:46 UTC
From:
To:
* Jakub Wilk <jwilk@jwilk.net>, 2022-09-02 20:13:

I have no idea what I'm doing, but something like this works:

   .de htmlonly
   .if '\*(.T'html' \\$1
   ..
   .TH
   .IP 1. 4
   .UR https://bar.example
   .htmlonly https://bar.example
   .UE

#1018965#20
Date:
2023-07-21 09:41:22 UTC
From:
To:
retitle 1018965 groff -man -Thtml: malformed table when .IP+.UR+no link text
forwarded 1018965 https://savannah.gnu.org/bugs/?64453
thanks