aboutsummaryrefslogtreecommitdiffstats
path: root/tbl_html.c
diff options
context:
space:
mode:
authorBaptiste Daroussin <bapt@FreeBSD.org>2017-01-21 13:01:39 +0000
committerBaptiste Daroussin <bapt@FreeBSD.org>2017-01-21 13:01:39 +0000
commitef7476572c9a18c0cb4d5dbaf3a81f1628419abb (patch)
tree0358496ea53f35b6dc31f8a296a2021c99db1b89 /tbl_html.c
parent05798824d24a3b26ef3439303ad694202c75729e (diff)
downloadsrc-ef7476572c9a18c0cb4d5dbaf3a81f1628419abb.tar.gz
src-ef7476572c9a18c0cb4d5dbaf3a81f1628419abb.zip
Import mandoc cvs snapshot 20170121 (pre 1.14)vendor/mandoc/20170121
Notes
Notes: svn path=/vendor/mdocml/dist/; revision=312591 svn path=/vendor/mdocml/20170121/; revision=312592; tag=vendor/mandoc/20170121
Diffstat (limited to 'tbl_html.c')
-rw-r--r--tbl_html.c32
1 files changed, 10 insertions, 22 deletions
diff --git a/tbl_html.c b/tbl_html.c
index 51c43286cbeb..962d900e3682 100644
--- a/tbl_html.c
+++ b/tbl_html.c
@@ -1,7 +1,7 @@
-/* $Id: tbl_html.c,v 1.18 2015/10/12 00:08:16 schwarze Exp $ */
+/* $Id: tbl_html.c,v 1.19 2017/01/17 01:47:51 schwarze Exp $ */
/*
* Copyright (c) 2011 Kristaps Dzonsons <kristaps@bsd.lv>
- * Copyright (c) 2014, 2015 Ingo Schwarze <schwarze@openbsd.org>
+ * Copyright (c) 2014, 2015, 2017 Ingo Schwarze <schwarze@openbsd.org>
*
* Permission to use, copy, modify, and distribute this software for any
* purpose with or without fee is hereby granted, provided that the above
@@ -50,9 +50,6 @@ html_tbl_strlen(const char *p, void *arg)
static void
html_tblopen(struct html *h, const struct tbl_span *sp)
{
- struct htmlpair tag;
- struct roffsu su;
- struct roffcol *col;
int ic;
if (h->tbl.cols == NULL) {
@@ -62,19 +59,12 @@ html_tblopen(struct html *h, const struct tbl_span *sp)
}
assert(NULL == h->tblt);
- PAIR_CLASS_INIT(&tag, "tbl");
- h->tblt = print_otag(h, TAG_TABLE, 1, &tag);
-
- for (ic = 0; ic < sp->opts->cols; ic++) {
- bufinit(h);
- col = h->tbl.cols + ic;
- SCALE_HS_INIT(&su, col->width);
- bufcat_su(h, "width", &su);
- PAIR_STYLE_INIT(&tag, h);
- print_otag(h, TAG_COL, 1, &tag);
- }
+ h->tblt = print_otag(h, TAG_TABLE, "c", "tbl");
+
+ for (ic = 0; ic < sp->opts->cols; ic++)
+ print_otag(h, TAG_COL, "shw", h->tbl.cols[ic].width);
- print_otag(h, TAG_TBODY, 0, NULL);
+ print_otag(h, TAG_TBODY, "");
}
void
@@ -90,7 +80,6 @@ void
print_tbl(struct html *h, const struct tbl_span *sp)
{
const struct tbl_dat *dp;
- struct htmlpair tag;
struct tag *tt;
int ic;
@@ -104,19 +93,18 @@ print_tbl(struct html *h, const struct tbl_span *sp)
h->flags |= HTML_NONOSPACE;
h->flags |= HTML_NOSPACE;
- tt = print_otag(h, TAG_TR, 0, NULL);
+ tt = print_otag(h, TAG_TR, "");
switch (sp->pos) {
case TBL_SPAN_HORIZ:
case TBL_SPAN_DHORIZ:
- PAIR_INIT(&tag, ATTR_COLSPAN, "0");
- print_otag(h, TAG_TD, 1, &tag);
+ print_otag(h, TAG_TD, "?", "colspan", "0");
break;
default:
dp = sp->first;
for (ic = 0; ic < sp->opts->cols; ic++) {
print_stagq(h, tt);
- print_otag(h, TAG_TD, 0, NULL);
+ print_otag(h, TAG_TD, "");
if (dp == NULL || dp->layout->col > ic)
continue;