From 4a73f17afb66c14ec34b806d0b4ee5dd5ea56ed2 Mon Sep 17 00:00:00 2001 From: Kristaps Dzonsons Date: Sat, 10 Oct 2009 11:05:23 +0000 Subject: Fix hang lists in -Tascii -Tmdoc, which seem to have been broken since ~1.8.x. Noted similarity of HP/TP and -hang/-tag in mandoc.1. --- mandoc.1 | 24 ++++++++++++++++++++++-- mdoc_term.c | 37 +------------------------------------ term.c | 10 ++++++++-- 3 files changed, 31 insertions(+), 40 deletions(-) diff --git a/mandoc.1 b/mandoc.1 index cce6f834..ce34744d 100644 --- a/mandoc.1 +++ b/mandoc.1 @@ -1,4 +1,4 @@ -.\" $Id: mandoc.1,v 1.41 2009/10/03 16:36:06 kristaps Exp $ +.\" $Id: mandoc.1,v 1.42 2009/10/10 11:05:23 kristaps Exp $ .\" .\" Copyright (c) 2009 Kristaps Dzonsons .\" @@ -14,7 +14,7 @@ .\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF .\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. .\" -.Dd $Mdocdate: October 3 2009 $ +.Dd $Mdocdate: October 10 2009 $ .Dt MANDOC 1 .Os . @@ -374,6 +374,26 @@ retains spaces. .It Sentences are unilaterally monospaced. .El +. +.Ss HTML output +.Bl -bullet -compact +.It +The +.Xr mdoc 7 +.Sq \&Bl \-hang +and +.Sq \&Bl \-tag +list types render similarly (no break following overreached left-hand +side) due to the expressive constraints of HTML. +. +.It +The +.Xr man 7 +.Sq IP +and +.Sq TP +lists render similarly. +.El .\" SECTION .Sh SEE ALSO .Xr mandoc_char 7 , diff --git a/mdoc_term.c b/mdoc_term.c index 0a13e5a6..722ca98a 100644 --- a/mdoc_term.c +++ b/mdoc_term.c @@ -1,4 +1,4 @@ -/* $Id: mdoc_term.c,v 1.87 2009/10/07 12:20:20 kristaps Exp $ */ +/* $Id: mdoc_term.c,v 1.88 2009/10/10 11:05:23 kristaps Exp $ */ /* * Copyright (c) 2008, 2009 Kristaps Dzonsons * @@ -26,41 +26,6 @@ #include "term.h" #include "mdoc.h" -/* FIXME: check HANG lists: they seem to be broken... : - * .Bl -hang -width Ds - * .It a - * b - * .It Fl f Ns Ar option... - * Override default compiler behaviour. See - * .Sx Compiler Options - * for details. - * Override default compiler behaviour. See - * .Sx Compiler Options - * for details. - * Override default compiler behaviour. See - * .Sx Compiler Options - * for details. - * Override default compiler behaviour. See - * .Sx Compiler Options - * for details. - * . - * .It a sasd fasd as afsd sfad sfds sadfs sd sfd ssfad asfd - * Override default compiler behaviour. See - * .Sx Compiler Options - * for details. - * Override default compiler behaviour. See - * .Sx Compiler Options - * for details. - * Override default compiler behaviour. See - * .Sx Compiler Options - * for details. - * Override default compiler behaviour. See - * .Sx Compiler Options - * for details. - * .El - * - */ - #define INDENT 5 #define HALFINDENT 3 diff --git a/term.c b/term.c index 0a7739da..9ac3039f 100644 --- a/term.c +++ b/term.c @@ -1,4 +1,4 @@ -/* $Id: term.c,v 1.103 2009/09/23 11:02:21 kristaps Exp $ */ +/* $Id: term.c,v 1.104 2009/10/10 11:05:23 kristaps Exp $ */ /* * Copyright (c) 2008, 2009 Kristaps Dzonsons * @@ -159,7 +159,7 @@ void term_flushln(struct termp *p) { int i, j; - size_t vbl, vsz, vis, maxvis, mmax, bp; + size_t vbl, vsz, vis, maxvis, mmax, bp, os; static int overstep = 0; /* @@ -172,6 +172,9 @@ term_flushln(struct termp *p) assert(p->offset < p->rmargin); assert((int)(p->rmargin - p->offset) - overstep > 0); + /* Save the overstep. */ + os = (size_t)overstep; + maxvis = /* LINTED */ p->rmargin - p->offset - overstep; mmax = /* LINTED */ @@ -233,6 +236,9 @@ term_flushln(struct termp *p) putchar(' '); vis = 0; } + /* Remove the overstep width. */ + bp += os; + os = 0; } else { for (j = 0; j < (int)vbl; j++) putchar(' '); -- cgit v1.2.3