summaryrefslogtreecommitdiffstats
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
commit2c4d7545dc7122e64a3537a972948c11722caad1 (patch)
treef978939fe8567895035750760f403f296b47f388
parent57f76c2123c01f79e1d01a5738b75ab7ae7dacab (diff)
downloadmandoc-2c4d7545dc7122e64a3537a972948c11722caad1.tar.gz
Prettier HTML.
-rw-r--r--Makefile2
-rw-r--r--html.c19
-rw-r--r--html.h4
-rw-r--r--tags.c2
4 files changed, 21 insertions, 6 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 156ac3cc..b71e9fca 100644
--- a/html.c
+++ b/html.c
@@ -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 148ea6f0..b73a3a4b 100644
--- a/html.h
+++ b/html.h
@@ -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 6ff3ba6c..cbc498a3 100644
--- a/tags.c
+++ b/tags.c
@@ -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[] = {