summaryrefslogtreecommitdiffstatshomepage
path: root/mdoc_html.c
diff options
context:
space:
mode:
authorKristaps Dzonsons <kristaps@bsd.lv>2010-06-12 12:38:01 +0000
committerKristaps Dzonsons <kristaps@bsd.lv>2010-06-12 12:38:01 +0000
commite9ed9b35dc4fd863125a597aff030d991806984f (patch)
treea7b1d31fe327e49f2e1efc63d76f3cf1b8149f3a /mdoc_html.c
parentab3ccf15eb37629459a92cd73cea7a345c475754 (diff)
downloadmandoc-e9ed9b35dc4fd863125a597aff030d991806984f.tar.gz
mandoc-e9ed9b35dc4fd863125a597aff030d991806984f.tar.zst
mandoc-e9ed9b35dc4fd863125a597aff030d991806984f.zip
Cached `Bl -offset' into mdoc_bl. Removed erroneous "-offset defaults
to 6n if no value is specified" and added regression tests for `Bl' testing against the empty -offset argument.
Diffstat (limited to 'mdoc_html.c')
-rw-r--r--mdoc_html.c14
1 files changed, 5 insertions, 9 deletions
diff --git a/mdoc_html.c b/mdoc_html.c
index ac58c701..bc483471 100644
--- a/mdoc_html.c
+++ b/mdoc_html.c
@@ -1,4 +1,4 @@
-/* $Id: mdoc_html.c,v 1.82 2010/06/12 12:10:55 kristaps Exp $ */
+/* $Id: mdoc_html.c,v 1.83 2010/06/12 12:38:01 kristaps Exp $ */
/*
* Copyright (c) 2008, 2009 Kristaps Dzonsons <kristaps@kth.se>
*
@@ -1035,12 +1035,13 @@ mdoc_it_pre(MDOC_ARGS)
if (MDOC_BLOCK != n->type)
bl = bl->parent;
+ SCALE_HS_INIT(&offs, 0);
+
type = bl->data.Bl.type;
comp = bl->data.Bl.comp;
- /* Set default width and offset. */
-
- SCALE_HS_INIT(&offs, 0);
+ if (bl->data.Bl.offs)
+ a2offs(bl->data.Bl.offs, &offs);
switch (type) {
case (LIST_enum):
@@ -1057,8 +1058,6 @@ mdoc_it_pre(MDOC_ARGS)
break;
}
- /* Get width, offset, and compact arguments. */
-
wp = -1;
for (i = 0; bl->args && i < (int)bl->args->argc; i++)
switch (bl->args->argv[i].arg) {
@@ -1068,9 +1067,6 @@ mdoc_it_pre(MDOC_ARGS)
case (MDOC_Width):
a2width(bl->args->argv[i].value[0], &width);
break;
- case (MDOC_Offset):
- a2offs(bl->args->argv[i].value[0], &offs);
- break;
default:
break;
}