aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/mdoc.h
diff options
context:
space:
mode:
authorIngo Schwarze <schwarze@openbsd.org>2012-11-16 17:16:55 +0000
committerIngo Schwarze <schwarze@openbsd.org>2012-11-16 17:16:55 +0000
commitccb2b6c5e221f64660f6481251aaaf2dbd12679a (patch)
treecc6a0d77c99954bf2a563f9d3a06945037359ce9 /mdoc.h
parented556a16a0d0d619b59f20de7ff6e61eb00b0fde (diff)
downloadmandoc-ccb2b6c5e221f64660f6481251aaaf2dbd12679a.tar.gz
mandoc-ccb2b6c5e221f64660f6481251aaaf2dbd12679a.tar.zst
mandoc-ccb2b6c5e221f64660f6481251aaaf2dbd12679a.zip
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 'mdoc.h')
-rw-r--r--mdoc.h3
1 files changed, 2 insertions, 1 deletions
diff --git a/mdoc.h b/mdoc.h
index 55536777..cc807d77 100644
--- a/mdoc.h
+++ b/mdoc.h
@@ -1,4 +1,4 @@
-/* $Id: mdoc.h,v 1.123 2012/07/10 14:38:51 schwarze Exp $ */
+/* $Id: mdoc.h,v 1.124 2012/11/16 17:16:55 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 */