From ccb2b6c5e221f64660f6481251aaaf2dbd12679a Mon Sep 17 00:00:00 2001 From: Ingo Schwarze Date: Fri, 16 Nov 2012 17:16:55 +0000 Subject: 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. --- mdoc.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'mdoc.h') 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 * @@ -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 */ -- cgit v1.2.3-56-ge451