summaryrefslogtreecommitdiff
path: root/usr.bin/mandoc/mdoc.h
diff options
context:
space:
mode:
authorIngo Schwarze <schwarze@cvs.openbsd.org>2012-11-16 17:16:30 +0000
committerIngo Schwarze <schwarze@cvs.openbsd.org>2012-11-16 17:16:30 +0000
commit06de48388a133b00eb9122b0fa77d1ee45f80c83 (patch)
tree66c3c632a4249b4158581770ef8f5f0473f3910a /usr.bin/mandoc/mdoc.h
parentc267ec5f9cd76a1825c19cb92ba242a1806f6cc3 (diff)
Improve formatting of badly nested font blocks.
The basic idea is to already pop the font at the end marker instead of allowing it to linger until the final end of the block. This requires a few preliminaries: * For each block, save a pointer to the previous font to be used in case the block breaks another and gets extended. * That requires making node information writable during rendering. * Now fonts may get popped in the wrong order; hence, after the stack has already been rewound further by some block that began earlier, ignore popping a font that was put on the stack later. * To be able to exploit all this for font blocks, tie processing to their body, not their block, which is more logical anyway. Triggered by florian@ reporting vaguely similar issues with list blocks.
Diffstat (limited to 'usr.bin/mandoc/mdoc.h')
-rw-r--r--usr.bin/mandoc/mdoc.h3
1 files changed, 2 insertions, 1 deletions
diff --git a/usr.bin/mandoc/mdoc.h b/usr.bin/mandoc/mdoc.h
index 109e7f4b6bc..bdd289b7249 100644
--- a/usr.bin/mandoc/mdoc.h
+++ b/usr.bin/mandoc/mdoc.h
@@ -1,4 +1,4 @@
-/* $Id: mdoc.h,v 1.47 2012/07/10 14:35:57 schwarze Exp $ */
+/* $Id: mdoc.h,v 1.48 2012/11/16 17:16:29 schwarze Exp $ */
/*
* Copyright (c) 2008, 2009, 2010, 2011 Kristaps Dzonsons <kristaps@bsd.lv>
*
@@ -363,6 +363,7 @@ struct mdoc_node {
enum mdoc_type type; /* AST node type */
enum mdoc_sec sec; /* current named section */
union mdoc_data *norm; /* normalised args */
+ const void *prev_font; /* before entering this node */
/* FIXME: these can be union'd to shave a few bytes. */
struct mdoc_arg *args; /* BLOCK/ELEM */
struct mdoc_node *pending; /* BLOCK */