summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKristaps Dzonsons <kristaps@bsd.lv>2009-10-10 11:05:23 +0000
committerKristaps Dzonsons <kristaps@bsd.lv>2009-10-10 11:05:23 +0000
commit3dd53e4cb80fd56800af2570b55975d91b4d4c06 (patch)
tree4ad33b89cd5ac761969eef1bc3157d50a1d87bb5
parent0c97c0b66cc60a6e458173cbaf79405d051f920e (diff)
downloadmandoc-3dd53e4cb80fd56800af2570b55975d91b4d4c06.tar.gz
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.
-rw-r--r--mandoc.120
-rw-r--r--mdoc_term.c35
-rw-r--r--term.c8
3 files changed, 27 insertions, 36 deletions
diff --git a/mandoc.1 b/mandoc.1
index 66f5f371..ddee1ac1 100644
--- a/mandoc.1
+++ b/mandoc.1
@@ -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 df887ea6..08a546f5 100644
--- a/mdoc_term.c
+++ b/mdoc_term.c
@@ -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 2392a621..91638e25 100644
--- a/term.c
+++ b/term.c
@@ -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(' ');