diff options
author | Kristaps Dzonsons <kristaps@bsd.lv> | 2008-12-10 17:40:56 +0000 |
---|---|---|
committer | Kristaps Dzonsons <kristaps@bsd.lv> | 2008-12-10 17:40:56 +0000 |
commit | 2c4d7545dc7122e64a3537a972948c11722caad1 (patch) | |
tree | f978939fe8567895035750760f403f296b47f388 | |
parent | 57f76c2123c01f79e1d01a5738b75ab7ae7dacab (diff) | |
download | mandoc-2c4d7545dc7122e64a3537a972948c11722caad1.tar.gz |
Prettier HTML.
-rw-r--r-- | Makefile | 2 | ||||
-rw-r--r-- | html.c | 19 | ||||
-rw-r--r-- | html.h | 4 | ||||
-rw-r--r-- | tags.c | 2 |
4 files changed, 21 insertions, 6 deletions
@@ -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 @@ -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; } @@ -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 { @@ -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[] = { |