version 1.8, 2014/10/10 08:44:24 |
version 1.9, 2014/10/10 14:27:46 |
|
|
/* $Id$ */ |
/* $Id$ */ |
/* |
/* |
* Copyright (c) 2011 Kristaps Dzonsons <kristaps@bsd.lv> |
* Copyright (c) 2011, 2014 Kristaps Dzonsons <kristaps@bsd.lv> |
* |
* |
* Permission to use, copy, modify, and distribute this software for any |
* Permission to use, copy, modify, and distribute this software for any |
* purpose with or without fee is hereby granted, provided that the above |
* purpose with or without fee is hereby granted, provided that the above |
Line 54 eqn_box(struct html *p, const struct eqn_box *bp) |
|
Line 54 eqn_box(struct html *p, const struct eqn_box *bp) |
|
/* Estimate the number of rows, first. */ |
/* Estimate the number of rows, first. */ |
if (NULL == (child = parent->first)) |
if (NULL == (child = parent->first)) |
goto out; |
goto out; |
for (rows = 0; NULL != child; rows++) |
for (rows = 0; NULL != child; rows++) |
child = child->next; |
child = child->next; |
/* Print row-by-row. */ |
/* Print row-by-row. */ |
post = print_otag(p, TAG_MTABLE, 0, NULL); |
post = print_otag(p, TAG_MTABLE, 0, NULL); |
Line 70 eqn_box(struct html *p, const struct eqn_box *bp) |
|
Line 70 eqn_box(struct html *p, const struct eqn_box *bp) |
|
} |
} |
cell = print_otag |
cell = print_otag |
(p, TAG_MTD, 0, NULL); |
(p, TAG_MTD, 0, NULL); |
/* |
/* |
* If we have no data for this |
* If we have no data for this |
* particular cell, then print a |
* particular cell, then print a |
* placeholder and continue--don't puke. |
* placeholder and continue--don't puke. |
*/ |
*/ |
if (NULL != child) |
if (NULL != child) |
eqn_box(p, child->first); |
eqn_box(p, child->first); |
print_tagq(p, cell); |
print_tagq(p, cell); |
parent = parent->next; |
parent = parent->next; |
Line 137 eqn_box(struct html *p, const struct eqn_box *bp) |
|
Line 137 eqn_box(struct html *p, const struct eqn_box *bp) |
|
assert(NULL == post); |
assert(NULL == post); |
post = print_otag(p, TAG_MI, 0, NULL); |
post = print_otag(p, TAG_MI, 0, NULL); |
print_text(p, bp->text); |
print_text(p, bp->text); |
} else if (NULL == post) { |
} else if (NULL == post) { |
if (NULL != bp->left || NULL != bp->right) { |
if (NULL != bp->left || NULL != bp->right) { |
PAIR_INIT(&tag[0], ATTR_OPEN, |
PAIR_INIT(&tag[0], ATTR_OPEN, |
NULL == bp->left ? "" : bp->left); |
NULL == bp->left ? "" : bp->left); |
PAIR_INIT(&tag[1], ATTR_CLOSE, |
PAIR_INIT(&tag[1], ATTR_CLOSE, |
NULL == bp->right ? "" : bp->right); |
NULL == bp->right ? "" : bp->right); |
post = print_otag(p, TAG_MFENCED, 2, tag); |
post = print_otag(p, TAG_MFENCED, 2, tag); |
} |
} |
if (NULL == post) |
if (NULL == post) |
post = print_otag(p, TAG_MROW, 0, NULL); |
post = print_otag(p, TAG_MROW, 0, NULL); |
else |
else |
|
|
t = print_otag(p, TAG_MO, 0, NULL); |
t = print_otag(p, TAG_MO, 0, NULL); |
print_text(p, bp->bottom); |
print_text(p, bp->bottom); |
print_tagq(p, t); |
print_tagq(p, t); |
} |
} |
if (NULL != bp->top) { |
if (NULL != bp->top) { |
t = print_otag(p, TAG_MO, 0, NULL); |
t = print_otag(p, TAG_MO, 0, NULL); |
print_text(p, bp->top); |
print_text(p, bp->top); |