aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/mdoc_html.c
diff options
context:
space:
mode:
authorIngo Schwarze <schwarze@openbsd.org>2014-12-23 13:48:57 +0000
committerIngo Schwarze <schwarze@openbsd.org>2014-12-23 13:48:57 +0000
commite98af5414161553ffd7b765ad3a2451626334232 (patch)
tree71e081d88f9d7e31540b032aa105d2794f17c438 /mdoc_html.c
parentff9ffdaa32c8d8843620079281b5c445b548babc (diff)
downloadmandoc-e98af5414161553ffd7b765ad3a2451626334232.tar.gz
mandoc-e98af5414161553ffd7b765ad3a2451626334232.tar.zst
mandoc-e98af5414161553ffd7b765ad3a2451626334232.zip
support negative horizontal widths in man(7);
minus twenty lines of code in spite of enhanced functionality
Diffstat (limited to 'mdoc_html.c')
-rw-r--r--mdoc_html.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/mdoc_html.c b/mdoc_html.c
index efdd78f4..137a763f 100644
--- a/mdoc_html.c
+++ b/mdoc_html.c
@@ -1,4 +1,4 @@
-/* $Id: mdoc_html.c,v 1.217 2014/12/23 09:31:46 schwarze Exp $ */
+/* $Id: mdoc_html.c,v 1.218 2014/12/23 13:48:57 schwarze Exp $ */
/*
* Copyright (c) 2008-2011, 2014 Kristaps Dzonsons <kristaps@bsd.lv>
* Copyright (c) 2014 Ingo Schwarze <schwarze@openbsd.org>
@@ -282,7 +282,8 @@ a2width(const char *p, struct roffsu *su)
if (a2roffsu(p, su, SCALE_MAX) < 2) {
su->unit = SCALE_EN;
su->scale = html_strlen(p);
- }
+ } else if (su->scale < 0.0)
+ su->scale = 0.0;
}
/*
@@ -1566,9 +1567,12 @@ mdoc_sp_pre(MDOC_ARGS)
SCALE_VS_INIT(&su, 1);
if (MDOC_sp == n->tok) {
- if (NULL != (n = n->child))
+ if (NULL != (n = n->child)) {
if ( ! a2roffsu(n->string, &su, SCALE_VS))
su.scale = 1.0;
+ else if (su.scale < 0.0)
+ su.scale = 0.0;
+ }
} else
su.scale = 0.0;