#1029089 mandoc: -Thtml renders .Em as a hyperlink

Package:
mandoc
Source:
mandoc
Description:
BSD manpage compiler toolset
Submitter:
Colin Watson
Date:
2023-01-17 16:42:02 UTC
Severity:
normal
#1029089#5
Date:
2023-01-17 15:14:14 UTC
From:
To:
I was in the process of referring a user to
https://manpages.debian.org/bullseye/germinate/germinate.1.en.html, and
I happened to notice that some things are rendered oddly.  This input:

  The contents of the Ubuntu distribution, and others, are managed by means of
  .Em seeds .

... is rendered as follows by "mandoc -Thtml":

  <p class="Pp">The contents of the Ubuntu distribution, and others, are managed
      by means of
      <a class="permalink" href="#seeds"><i class="Em" id="seeds">seeds</i></a>.

Perhaps there's some reason for this, but it looks odd - the effect is a
hyperlink to the same place in the document - and it seems to deviate
from the documented semantics of .Em.  mdoc(7) says:

     Em word ...
          Request an italic font.  If the output device does not provide that,
          underline.

          This is most often used for stress emphasis (not to be confused with
          importance, see Sy).  In the rare cases where none of the semantic
          markup macros fit, it can also be used for technical terms and
          placeholders, except that for syntax elements, Sy and Ar are
          preferred, respectively.

          Examples:
                Selected lines are those
                .Em not
                matching any of the specified patterns.
                Some of the functions use a
                .Em hold space
                to save the pattern space for subsequent retrieval.

          See also No, Ql, and Sy.

... while groff_mdoc(7) says:

   Emphasis Macro
     Text may be stressed or emphasized with the ‘.Em’ macro.  The usual font
     for emphasis is italic.

           Usage: .Em ⟨argument⟩ ...

                    .Em does not          does not
                    .Em exceed 1024 .     exceed 1024.
                    .Em vide infra ) ) ,  vide infra)),

     The default width is 10n.

Maybe this is just an accidental consequence of something else and can
be fixed; I don't see a reason why we need more than italic-font
emphasis here.  But if it's deliberate, please could there at least be a
portable way to suppress the spurious hyperlinks?

#1029089#10
Date:
2023-01-17 16:39:42 UTC
From:
To:
Can you report this upstream at https://mandoc.bsd.lv/contact.html please?