summaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorKristaps Dzonsons <kristaps@bsd.lv>2008-12-10 17:40:56 +0000
committerKristaps Dzonsons <kristaps@bsd.lv>2008-12-10 17:40:56 +0000
commitba7926bca9c9a2ed849e0132be444c7848e2d25c (patch)
tree5b76df1e60ae6b9ef93e34c462f6fbfb1a6e27ce
parent1b8d9fa897a46e8f13fd5cda411e2cd8baf7b7bd (diff)
downloadmandoc-ba7926bca9c9a2ed849e0132be444c7848e2d25c.tar.gz
mandoc-ba7926bca9c9a2ed849e0132be444c7848e2d25c.tar.zst
mandoc-ba7926bca9c9a2ed849e0132be444c7848e2d25c.zip
Prettier HTML.
-rw-r--r--Makefile2
-rw-r--r--html.c21
-rw-r--r--html.h6
-rw-r--r--tags.c4
4 files changed, 24 insertions, 9 deletions
diff --git a/Makefile b/Makefile
index 618046fe..4c8efc2d 100644
--- a/Makefile
+++ b/Makefile
@@ -1,7 +1,7 @@
VERSION = 1.0.3
# FIXME
-CFLAGS += -W -Wall -Wno-unused-parameter -g
+CFLAGS += -W -Wall -Wno-unused-parameter -g -DDEBUG
LNS = mdocml.ln html.ln xml.ln libmdocml.ln roff.ln ml.ln mlg.ln \
compat.ln tokens.ln literals.ln tags.ln noop.ln
diff --git a/html.c b/html.c
index 22c0bd50..87cda22c 100644
--- a/html.c
+++ b/html.c
@@ -1,4 +1,4 @@
-/* $Id: html.c,v 1.25 2008/12/10 17:31:57 kristaps Exp $ */
+/* $Id: html.c,v 1.26 2008/12/10 17:40:56 kristaps Exp $ */
/*
* Copyright (c) 2008 Kristaps Dzonsons <kristaps@kth.se>
*
@@ -127,6 +127,7 @@ html_It_headtagname(struct md_mbuf *mbuf, struct htmlq *q,
{
struct htmlnode *n;
int i;
+ struct html_pair attr[2];
for (n = q->last; n; n = n->parent)
if (n->tok == ROFF_Bl)
@@ -141,9 +142,17 @@ html_It_headtagname(struct md_mbuf *mbuf, struct htmlq *q,
case (ROFF_Ohang):
return(html_stput(mbuf, HTML_TAG_DIV, res));
case (ROFF_Tag):
- /* FALLTHROUGH */
+ attr[0].attr = HTML_ATTR_VALIGN;
+ attr[0].val = "top";
+ attr[1].attr = HTML_ATTR_NOWRAP;
+ attr[1].val = "true";
+ return(html_saput(mbuf, HTML_TAG_TD,
+ res, 2, attr));
case (ROFF_Column):
- return(html_stput(mbuf, HTML_TAG_TD, res));
+ attr[0].attr = HTML_ATTR_VALIGN;
+ attr[0].val = "top";
+ return(html_saput(mbuf, HTML_TAG_TD,
+ res, 1, attr));
default:
break;
}
@@ -160,6 +169,7 @@ html_It_bodytagname(struct md_mbuf *mbuf, struct htmlq *q,
{
struct htmlnode *n;
int i;
+ struct html_pair attr[1];
for (n = q->last; n; n = n->parent)
if (n->tok == ROFF_Bl)
@@ -192,7 +202,10 @@ html_It_bodytagname(struct md_mbuf *mbuf, struct htmlq *q,
case (ROFF_Tag):
/* FALLTHROUGH */
case (ROFF_Column):
- return(html_stput(mbuf, HTML_TAG_TD, res));
+ attr[0].attr = HTML_ATTR_VALIGN;
+ attr[0].val = "top";
+ return(html_saput(mbuf, HTML_TAG_TD,
+ res, 1, attr));
default:
break;
}
diff --git a/html.h b/html.h
index 49b7eac1..854e4ff6 100644
--- a/html.h
+++ b/html.h
@@ -1,4 +1,4 @@
-/* $Id: html.h,v 1.3 2008/12/10 12:09:47 kristaps Exp $ */
+/* $Id: html.h,v 1.4 2008/12/10 17:40:56 kristaps Exp $ */
/*
* Copyright (c) 2008 Kristaps Dzonsons <kristaps@kth.se>
*
@@ -51,7 +51,9 @@ enum html_attr {
HTML_ATTR_REL = 5,
HTML_ATTR_HREF = 6,
HTML_ATTR_WIDTH = 7,
- HTML_ATTR_ALIGN = 8
+ HTML_ATTR_ALIGN = 8,
+ HTML_ATTR_VALIGN = 9,
+ HTML_ATTR_NOWRAP = 10
};
enum html_type {
diff --git a/tags.c b/tags.c
index 35c0655e..d0f928b2 100644
--- a/tags.c
+++ b/tags.c
@@ -1,4 +1,4 @@
-/* $Id: tags.c,v 1.2 2008/12/10 00:58:15 kristaps Exp $ */
+/* $Id: tags.c,v 1.3 2008/12/10 17:40:56 kristaps Exp $ */
/*
* Copyright (c) 2008 Kristaps Dzonsons <kristaps@kth.se>
*
@@ -37,7 +37,7 @@ static const char * const tagnames[] = {
static const char * const attrnames[] = {
"class", "http-equiv", "content", "name",
"type", "rel", "href", "width",
- "align",
+ "align", "valign", "nowrap",
};
static const char * const typenames[] = {