From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on inbox.vuxu.org X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=ham autolearn_force=no version=3.4.4 Received: (qmail 25142 invoked from network); 16 Oct 2023 14:52:20 -0000 Received: from bsd.lv (HELO mandoc.bsd.lv) (66.111.2.12) by inbox.vuxu.org with ESMTPUTF8; 16 Oct 2023 14:52:20 -0000 Received: from fantadrom.bsd.lv (localhost [127.0.0.1]) by mandoc.bsd.lv (OpenSMTPD) with ESMTP id d1850720 for ; Mon, 16 Oct 2023 14:52:18 +0000 (UTC) Received: from scc-mailout-kit-02.scc.kit.edu (scc-mailout-kit-02.scc.kit.edu [129.13.231.82]) by mandoc.bsd.lv (OpenSMTPD) with ESMTP id 83f08746 for ; Mon, 16 Oct 2023 14:52:17 +0000 (UTC) Received: from hekate.asta.kit.edu ([2a00:1398:5:f401::77]) by scc-mailout-kit-02.scc.kit.edu with esmtps (TLS1.3:ECDHE_SECP256R1__RSA_PSS_RSAE_SHA256__AES_256_GCM:256) (envelope-from ) id 1qsOx6-0066P9-1k; Mon, 16 Oct 2023 16:52:17 +0200 Received: from login-1.asta.kit.edu ([2a00:1398:5:f400::72]) by hekate.asta.kit.edu with esmtp (Exim 4.94.2) (envelope-from ) id 1qsOx5-0005aV-Lz; Mon, 16 Oct 2023 16:52:15 +0200 Received: from schwarze by login-1.asta.kit.edu with local (Exim 4.94.2) (envelope-from ) id 1qsOx4-000Umf-Vs; Mon, 16 Oct 2023 16:52:14 +0200 Date: Mon, 16 Oct 2023 16:52:14 +0200 From: Ingo Schwarze To: Alejandro Colomar Cc: tech@mandoc.bsd.lv Subject: Re: mandoc -man -Thtml: unwanted line break after bullet (.IP) Message-ID: References: X-Mailinglist: mandoc-tech Reply-To: tech@mandoc.bsd.lv MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Hi Alejandro, Alejandro Colomar wrote on Mon, Oct 16, 2023 at 03:17:07PM +0200: > mandoc -man -Thtml produces a line break after a .IP \[bu] 3 > groff(1) doesn't, which is consistent with how both mandoc(1) and > groff(1) format that code in a terminal. > > Is that behavior intended, or accidental? So far, i'm unable to reproduce your problem. With the test file appended below and the command mandoc -Thtml -Ostyle=mandoc.css test.1 > test.html i get the expected semantically correct output containing dl, dt, and dd elements, but not the br element that you claim to be present in the output you get. Specifically:

initial text

final text
For testing, i have also put up the file here: https://man.bsd.lv/Test/test.1 The output looks correct to me. There certainly isn't any line break after the bullet; as expected, the "final text" follows on the same line. Needless to say, when you worry about white space issues in web design, correctly using CSS is essential, because obviously, the HTML code only specifies the semantic structure of the text but does *not* specifiy physical formatting details like white space or line breaks. Can you be more specific which input file, which mandoc command, and which CSS file you are using? If you worry about the relatively wide indentation of the "final text", that's because mandoc.css hardcodes "margin-left: 5.5em;" for the .Bl-tag class. Theoretically, mandoc(1) could honour the .IP width argument by adding an explicit, physical-formatting "style" attribute to the individial HTML dl element. But adding style attributes to individual HTML elements is considered deprecated and very bad style in modern HTML, so mandoc doesn't do that. This really isn't specific to mandoc but applies to all web design in general. If you use any HTML autogeneration tool (not just mandoc) and embed any *physical* formatting instructions into your document source code (in this case, the width argument "3"), such crowbar-style coding will usually result in poor formatting or be ignored outright by the HTML generation tool. > You can check it in the same ftm(7) page that I reported a bug > recently. After copying https://manpages.debian.org/bullseye/manpages/ftm.7.en.html to my server at https://man.bsd.lv/Test/ftm.7#Feature_test_macros_understood_by_glibc i can't see the problem neither there nor on manpages.debian.org. Note that manpages.debian.org *does* use the mandoc rendering engine, so having a bug in mandoc that does not show up on manpages.debian.org would be slightly surprising, unless the bug was recently introduced in mandoc. Anyway, on both servers, i do not see line breaks after the bullets. For example, look at the lines: The macros that you most likely need to use ... Defining _XOPEN_SOURCE with a value of 700 or greater ... Yours, Ingo .TH TEST 1 .SH NAME test \- test .SH DESCRIPTION initial text .IP \[bu] 3 final text -- To unsubscribe send an email to tech+unsubscribe@mandoc.bsd.lv