aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/eqn_html.c
diff options
context:
space:
mode:
authorIngo Schwarze <schwarze@openbsd.org>2017-07-05 15:03:27 +0000
committerIngo Schwarze <schwarze@openbsd.org>2017-07-05 15:03:27 +0000
commitacb30a24128863f2d57ac9aa20a93c8dd243b80b (patch)
tree46474fe953b663899c9a6f1594eb3c8d197277ac /eqn_html.c
parent7db3d6e9ae386fc036279f2166b0ececc6cd6d27 (diff)
downloadmandoc-acb30a24128863f2d57ac9aa20a93c8dd243b80b.tar.gz
mandoc-acb30a24128863f2d57ac9aa20a93c8dd243b80b.tar.zst
mandoc-acb30a24128863f2d57ac9aa20a93c8dd243b80b.zip
The EQN_LISTONE box type is pointless.
Simplify by just using EQN_LIST with expectargs = 1. Noticed while investigating a bug report from bentley@. No functional change.
Diffstat (limited to 'eqn_html.c')
-rw-r--r--eqn_html.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/eqn_html.c b/eqn_html.c
index 2d9eeb8a..feeae102 100644
--- a/eqn_html.c
+++ b/eqn_html.c
@@ -1,4 +1,4 @@
-/* $Id: eqn_html.c,v 1.14 2017/06/23 23:00:01 schwarze Exp $ */
+/* $Id: eqn_html.c,v 1.15 2017/07/05 15:03:27 schwarze Exp $ */
/*
* Copyright (c) 2011, 2014 Kristaps Dzonsons <kristaps@bsd.lv>
* Copyright (c) 2017 Ingo Schwarze <schwarze@openbsd.org>
@@ -51,7 +51,8 @@ eqn_box(struct html *p, const struct eqn_box *bp)
if (EQN_MATRIX == bp->type) {
if (NULL == bp->first)
goto out;
- if (EQN_LIST != bp->first->type) {
+ if (bp->first->type != EQN_LIST ||
+ bp->first->expectargs == 1) {
eqn_box(p, bp->first);
goto out;
}
@@ -131,9 +132,11 @@ eqn_box(struct html *p, const struct eqn_box *bp)
if (EQN_PILE == bp->type) {
assert(NULL == post);
- if (bp->first != NULL && bp->first->type == EQN_LIST)
+ if (bp->first != NULL &&
+ bp->first->type == EQN_LIST &&
+ bp->first->expectargs > 1)
post = print_otag(p, TAG_MTABLE, "");
- } else if (bp->type == EQN_LIST &&
+ } else if (bp->type == EQN_LIST && bp->expectargs > 1 &&
bp->parent && bp->parent->type == EQN_PILE) {
assert(NULL == post);
post = print_otag(p, TAG_MTR, "");