From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-wm0-f48.google.com (mail-wm0-f48.google.com [74.125.82.48]) by fantadrom.bsd.lv (OpenSMTPD) with ESMTP id 27918901 for ; Mon, 16 Jul 2018 06:12:10 -0500 (EST) Received: by mail-wm0-f48.google.com with SMTP id c14-v6so4432920wmb.4 for ; Mon, 16 Jul 2018 04:12:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=resent-from:resent-date:resent-message-id:resent-to:date:from:to :subject:message-id:mime-version:content-disposition :content-transfer-encoding:user-agent; bh=R856Rn6e1f2XIqMO4rFJ/U1MFrTxBm1NjvbVhK3kFVU=; b=V9KWu3TgMxY3vxWnhBWAl4PYSOrRDLhceyVXTFRez9ceFeDJiO09QukwvWgiKRgdjM NasZiC4beABbnr8/IdGlzrPS/0Wd3iX9Zy//z4NLwaLyfOneoSDiOxhwW4WvfjxlX01L AvGzCXAvjHLApuaI0uh/tTctWQwebOlyY4Ad8rNSSL7JCcObxXImnV4wqOVGu2FqMF7x pR0XD/I4ia90i0sT8CSC5G3mCJGHv6tBk0OTqMC66Yq4l7P7M3zYd+DqMsAE+ltlzSTF d2AdUG4x/zv/RBF1fJ0t72S2Oqw0NHoU7Kgju20Sy3NkrhS/ZZTKQVSS6a1c+hYpFVlr 1mHg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:resent-from:resent-date:resent-message-id :resent-to:date:from:to:subject:message-id:mime-version :content-disposition:content-transfer-encoding:user-agent; bh=R856Rn6e1f2XIqMO4rFJ/U1MFrTxBm1NjvbVhK3kFVU=; b=ZEhNsf8xZXiFaJowW3QRcL0441Bd80wTpJoJKUUTRXF1le+6gfRxaI96dnnzVVZJ8d iJttvfVN7qvyU4Q4BTSwQMITGEJuWCWmMqHSIsPRsEWa3KsclW4yB2fgsCImk4Ojc2H6 iQO7JMUByAR+Rf7qQ6no3cl6Q6/cJ3Enz2NPB7t4k2Go2A+dDD+iLslq6VwZlojBs4Pu z+EiBcP1s7JuKuMfX4cN0Uz7kMcuvOnUqMAaK0hSD/IBS9HcPLYsb+bkP+EdPZrZ10NZ yIUAxAJEfjDavssRZaStS9rCysV4XSrfwPecUaXpsqyE8UFC6LjRwbKWjJiTuSUKWEr4 9BVA== X-Gm-Message-State: AOUpUlEFc0R8zuPDCZe5cMGzTcsWLra/mrGoSHSKRFsrGGhkRoJ3fM4b gLXiLJOyXQwrxniIHBfu6rD4KQ== X-Google-Smtp-Source: AAOMgpe5AMfzzcWVN7O0/mLzZmUpKi7up4W5q7a74+BQZprFf27AdhCIjbGFJP/O/dHsxtNIpXYZGA== X-Received: by 2002:a1c:3f45:: with SMTP id m66-v6mr9033990wma.37.1531739530070; Mon, 16 Jul 2018 04:12:10 -0700 (PDT) Received: from pali ([2a02:2b88:2:1::5cc6:2f]) by smtp.gmail.com with ESMTPSA id i1-v6sm19433970wrq.69.2018.07.16.04.12.09 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 16 Jul 2018 04:12:09 -0700 (PDT) Resent-From: Pali =?utf-8?B?Um9ow6Fy?= Resent-Date: Mon, 16 Jul 2018 13:12:09 +0200 Resent-Message-ID: <20180716111209.j57bq7cxskw4pqws@pali> Resent-To: discuss@mandoc.bsd.lv Received: from pali ([2a02:2b88:2:1::5cc6:2f]) by smtp.gmail.com with ESMTPSA id 35-v6sm26845885wri.78.2018.07.16.04.03.35 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 16 Jul 2018 04:03:36 -0700 (PDT) Date: Mon, 16 Jul 2018 13:03:35 +0200 From: Pali =?utf-8?B?Um9ow6Fy?= To: discuss@mandoc.bsd.lv Subject: Broken tables in HTML output Message-ID: <20180716110335.uusqzhscwdgp5qaa@pali> X-Mailinglist: mandoc-discuss Reply-To: discuss@mandoc.bsd.lv MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit User-Agent: NeoMutt/20170113 (1.7.2) Hi! It seems that mandoc is not able to format tables in HTML output correctly. Output is rather ugly which makes it less readable. First thing is that in HTML output is fully missing specified border even when in table section is box or | specified. This makes hard to understand meaning of some table when borders are important. Note that in ASCII output borders are rendered by '-', '+', '|' and '=' characters, so seems that mandoc already support borders, just HTML generator is buggy or does not support them at all. Second problem is with text alignment in table. When cell spanning is used (e.g. via s or via \^) then text is not correctly aligned and it looks "ugly". This problem is in both HTML and ASCII output. Third thing which I observed is that mandoc is in UTF-8 output does not use Unicode Box Drawing characters, but rather ugly ASCII. On following line is (simplified) manpage table: $ cat test.man .TS box; c s|c s c|c|c|c l|l|c|c. Very long text Another very long text _ Short shrt val1 val2 = Name 1 value1 value2 \^ 2 value3 \^ \^ 3 value4 \^ _ Name2 1 v1 v2 _ Name3 1 vv1 vv2 \^ 2 \^ vv4 .TE And output from groff man in UTF-8 mode is: $ man -Tutf8 ./test.man ┌───────────────┬────────────────────────┐ │Very long text │ Another very long text │ ├───────┬───────┼────────────┬───────────┤ │Short │ shrt │ val1 │ val2 │ ├───────┼───────┼────────────┼───────────┤ │ │ 1 │ value1 │ │ │Name │ 2 │ value3 │ value2 │ │ │ 3 │ value4 │ │ ├───────┼───────┼────────────┼───────────┤ │Name2 │ 1 │ v1 │ v2 │ ├───────┼───────┼────────────┼───────────┤ │Name3 │ 1 │ vv1 │ vv2 │ │ │ 2 │ │ vv4 │ └───────┴───────┴────────────┴───────────┘ Table has nice design, text is properly centered (both horizontally and vertically) and can be easily read. Only one error is missing double line between Short and Name rows. Output from mandoc in UTF-8 mode is ugly: $ mandoc -Tutf8 ./test.man +----------------------+---------------------------------+ | Very long text | Another very long text | +---------------+------+------------------------+--------+ | Short | shrt | val1 | val2 | +===============+======+========================+========+ |Name | 1 | value1 | value2 | | | 2 | value3 | | | | 3 | value4 | | +---------------+------+------------------------+--------+ |Name2 | 1 | v1 | v2 | +---------------+------+------------------------+--------+ |Name3 | 1 | vv1 | vv2 | | | 2 | | vv4 | +---------------+------+------------------------+--------+ It looks like it is no UTF-8, but rather ASCII. Column for val1 is enormously wide and val2 is too short without any reason. Both val1 and val2 columns have members of same sizes... Alignment is wrong. "Name" should be centered and not on top. Same for "value2". And now HTML output from mandoc: $ mandoc -Thtml ./test.man > test.html In web browser test.html file looks like this: Very long text Another very long text Short shrt val1 val2 Name 1 value1 value2 2 value3 3 value4 Name2 1 v1 v2 Name3 1 vv1 vv2 2 vv4 All borders are missing, cell spanning is broken, text is not aligned at all. Basically nothing is working and it hard to read and understood what this table means. So can you fix HTML generator in mandoc to produce better formatted HTML text. Because now ASCII version is better then what produce HTML. -- Pali Rohár pali.rohar@gmail.com -- To unsubscribe send an email to discuss+unsubscribe@mandoc.bsd.lv