From d5f546d82f5e5c88fe3f55abddb6ad82393ee6fd Mon Sep 17 00:00:00 2001 From: Ingo Schwarze Date: Sun, 8 Jan 2017 22:51:55 +0000 Subject: Indentation must be measured in units of the surrounding text, not in units of the contained text. Consequently, "display" and "lit" class tags must not be on the same element: First, "display" must set up the indentation, still using the outer units, and only after that, "lit" may change the font. This fixes .Bd -literal which got the wrong indentation. Bug reported by tb@. --- mdoc_html.c | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/mdoc_html.c b/mdoc_html.c index 8e21bc79..3a15f147 100644 --- a/mdoc_html.c +++ b/mdoc_html.c @@ -1,7 +1,7 @@ -/* $Id: mdoc_html.c,v 1.240 2016/01/08 17:48:09 schwarze Exp $ */ +/* $Id: mdoc_html.c,v 1.241 2017/01/08 22:51:55 schwarze Exp $ */ /* * Copyright (c) 2008-2011, 2014 Kristaps Dzonsons - * Copyright (c) 2014, 2015, 2016 Ingo Schwarze + * Copyright (c) 2014, 2015, 2016, 2017 Ingo Schwarze * * Permission to use, copy, modify, and distribute this software for any * purpose with or without fee is hereby granted, provided that the above @@ -1121,15 +1121,15 @@ mdoc_bd_pre(MDOC_ARGS) bufcat_su(h, "margin-left", &su); PAIR_STYLE_INIT(&tag[0], h); - if (DISP_unfilled != n->norm->Bd.type && - DISP_literal != n->norm->Bd.type) { - PAIR_CLASS_INIT(&tag[1], "display"); - print_otag(h, TAG_DIV, 2, tag); + PAIR_CLASS_INIT(&tag[1], "display"); + print_otag(h, TAG_DIV, 2, tag); + + if (n->norm->Bd.type != DISP_unfilled && + n->norm->Bd.type != DISP_literal) return 1; - } - PAIR_CLASS_INIT(&tag[1], "lit display"); - print_otag(h, TAG_PRE, 2, tag); + PAIR_CLASS_INIT(&tag[0], "lit"); + print_otag(h, TAG_PRE, 1, tag); /* This can be recursive: save & set our literal state. */ -- cgit v1.2.3-56-ge451