#916803 mdocml: HTML output uses block elements for inline text, causing bad rendering

Package:
mandoc
Source:
mdocml
Description:
BSD manpage compiler toolset
Submitter:
Thorsten Glaser
Date:
2018-12-18 21:03:03 UTC
Severity:
normal
#916803#5
Date:
2018-12-18 21:00:00 UTC
From:
To:
Steps to do:

$ zcat /usr/share/man/man1/lksh.1.gz | mandoc -Thtml >lksh.htm
$ lynx lksh.htm

This is on a Debian system with the mksh package installed.
Upstream developers can achieve the same with:

$ cvs -d _anoncvs@anoncvs.mirbsd.org:/cvs get -p mksh/lksh.1 | mandoc -Thtml >lksh.htm
$ lynx lksh.htm


The rendered output, in lynx(1), looks like this:

[2]SYNOPSIS

   lksh [
   -+abCefhiklmnprUuvXx
   ] [
   -+o opt
   ] [
   -c string | -s | file [
   args ...
   ]
   ]


The cause lies in the HTML:

    <td>[<div class="Op"><code class="Fl" title="Fl">-+abCefhiklmnprUuvXx</code></div>]

Blindly replacing _all_ div with span isn’t right either, but proves
that using span for inline markup is correct:

                                                   [2]SYNOPSIS

   lksh [-+abCefhiklmnprUuvXx] [-+o opt] [-c string | -s | file [args ...]]

HTML:

      [<span class="Op"><code class="Fl" title="Fl">-+o</code> <var class="Ar" title="Ar">opt</var></span>]


So, please use inline markup (span) instead of block markup (div) if you
wish to not produce linebreaks. Thanks!