.Oo No a Oc Oo No b Oc Oc Pq "break after first Oo"
.Ek
.Pp
-.\" XXX does not work yet
-.ig
.Nm
.Ar x x x x x x x x x x x x x x x x x x x x x x x x x x x
.Bk -words
.Oc Oo No b Oc Oc Pq "break before first Oc"
.Ek
.Pp
-..
.Nm
.Ar x x x x x x x x x x x x x x x x x x x x x x x x x x x
.Bk -words
B\bBk\bk-\b-i\bin\bnp\bpu\but\btl\bli\bin\bne\bes\bs _\bx _\bx _\bx _\bx _\bx _\bx _\bx _\bx _\bx _\bx _\bx _\bx _\bx _\bx _\bx _\bx _\bx _\bx _\bx _\bx _\bx _\bx _\bx _\bx _\bx _\bx _\bx
[[a] [b]] (break after first Oo)
+ B\bBk\bk-\b-i\bin\bnp\bpu\but\btl\bli\bin\bne\bes\bs _\bx _\bx _\bx _\bx _\bx _\bx _\bx _\bx _\bx _\bx _\bx _\bx _\bx _\bx _\bx _\bx _\bx _\bx _\bx _\bx _\bx _\bx _\bx _\bx _\bx _\bx _\bx
+ [[a] [b]] (break after second Oo)
+
+ B\bBk\bk-\b-i\bin\bnp\bpu\but\btl\bli\bin\bne\bes\bs _\bx _\bx _\bx _\bx _\bx _\bx _\bx _\bx _\bx _\bx _\bx _\bx _\bx _\bx _\bx _\bx _\bx _\bx _\bx _\bx _\bx _\bx _\bx _\bx _\bx _\bx _\bx
+ [[a] [b]] (break before first Oc)
+
B\bBk\bk-\b-i\bin\bnp\bpu\but\btl\bli\bin\bne\bes\bs _\bx _\bx _\bx _\bx _\bx _\bx _\bx _\bx _\bx _\bx _\bx _\bx _\bx _\bx _\bx _\bx _\bx _\bx _\bx _\bx _\bx _\bx _\bx _\bx _\bx _\bx _\bx [[a]
[b]] (break after first Oc)
-/* $Id: mdoc.c,v 1.95 2013/10/21 23:32:32 schwarze Exp $ */
+/* $Id: mdoc.c,v 1.96 2013/12/24 19:10:34 schwarze Exp $ */
/*
* Copyright (c) 2008, 2009, 2010, 2011 Kristaps Dzonsons <kristaps@bsd.lv>
* Copyright (c) 2010, 2012, 2013 Ingo Schwarze <schwarze@openbsd.org>
p->sec = mdoc->lastsec;
p->line = line;
p->pos = pos;
+ p->lastline = line;
p->tok = tok;
p->type = type;
-/* $Id: mdoc.h,v 1.48 2012/11/16 17:16:29 schwarze Exp $ */
+/* $Id: mdoc.h,v 1.49 2013/12/24 19:10:34 schwarze Exp $ */
/*
* Copyright (c) 2008, 2009, 2010, 2011 Kristaps Dzonsons <kristaps@bsd.lv>
*
int nchild; /* number children */
int line; /* parse line */
int pos; /* parse column */
+ int lastline; /* the node ends on this line */
enum mdoct tok; /* tok or MDOC__MAX if none */
int flags;
#define MDOC_VALID (1 << 0) /* has been validated */
-/* $Id: mdoc_html.c,v 1.67 2012/11/17 00:25:20 schwarze Exp $ */
+/* $Id: mdoc_html.c,v 1.68 2013/12/24 19:10:34 schwarze Exp $ */
/*
* Copyright (c) 2008, 2009, 2010, 2011 Kristaps Dzonsons <kristaps@bsd.lv>
*
break;
}
- if (HTML_KEEP & h->flags) {
- if (n->prev && n->prev->line != n->line) {
+ if (HTML_KEEP & h->flags || MDOC_SYNPRETTY & n->flags) {
+ if (n->prev ? (n->prev->lastline != n->line) :
+ (n->parent && n->parent->line != n->line)) {
h->flags &= ~HTML_KEEP;
h->flags |= HTML_PREKEEP;
- } else if (NULL == n->prev) {
- if (n->parent && n->parent->line != n->line) {
- h->flags &= ~HTML_KEEP;
- h->flags |= HTML_PREKEEP;
- }
}
}
-/* $Id: mdoc_macro.c,v 1.80 2013/10/21 23:32:32 schwarze Exp $ */
+/* $Id: mdoc_macro.c,v 1.81 2013/12/24 19:10:34 schwarze Exp $ */
/*
* Copyright (c) 2008-2012 Kristaps Dzonsons <kristaps@bsd.lv>
* Copyright (c) 2010, 2012, 2013 Ingo Schwarze <schwarze@openbsd.org>
case (REWIND_NONE):
return(1);
case (REWIND_THIS):
+ n->lastline = line -
+ (MDOC_NEWLINE & mdoc->flags &&
+ ! (MDOC_EXPLICIT & mdoc_macros[tok].flags));
break;
case (REWIND_FORCE):
mandoc_vmsg(MANDOCERR_SCOPEBROKEN, mdoc->parse,
mdoc_macronames[n->tok]);
/* FALLTHROUGH */
case (REWIND_MORE):
+ n->lastline = line -
+ (MDOC_NEWLINE & mdoc->flags ? 1 : 0);
n = n->parent;
continue;
case (REWIND_LATER):
-/* $Id: mdoc_term.c,v 1.153 2013/12/23 02:19:57 schwarze Exp $ */
+/* $Id: mdoc_term.c,v 1.154 2013/12/24 19:10:34 schwarze Exp $ */
/*
* Copyright (c) 2008, 2009, 2010, 2011 Kristaps Dzonsons <kristaps@bsd.lv>
* Copyright (c) 2010, 2012, 2013 Ingo Schwarze <schwarze@openbsd.org>
*/
if (TERMP_KEEP & p->flags || MDOC_SYNPRETTY & n->flags) {
- if (n->prev ? (n->prev->line != n->line) :
+ if (n->prev ? (n->prev->lastline != n->line) :
(n->parent && n->parent->line != n->line)) {
p->flags &= ~TERMP_KEEP;
p->flags |= TERMP_PREKEEP;
-/* $Id: tree.c,v 1.18 2013/09/15 17:33:47 schwarze Exp $ */
+/* $Id: tree.c,v 1.19 2013/12/24 19:10:34 schwarze Exp $ */
/*
* Copyright (c) 2008, 2009, 2011 Kristaps Dzonsons <kristaps@bsd.lv>
+ * Copyright (c) 2013 Ingo Schwarze <schwarze@openbsd.org>
*
* Permission to use, copy, modify, and distribute this software for any
* purpose with or without fee is hereby granted, provided that the above
putchar(' ');
if (MDOC_LINE & n->flags)
putchar('*');
- printf("%d:%d\n", n->line, n->pos);
+ printf("%d:%d", n->line, n->pos);
+ if (n->lastline != n->line)
+ printf("-%d", n->lastline);
+ putchar('\n');
}
if (n->child)