diff options
author | Kristaps Dzonsons <kristaps@bsd.lv> | 2014-09-27 10:56:18 +0000 |
---|---|---|
committer | Kristaps Dzonsons <kristaps@bsd.lv> | 2014-09-27 10:56:18 +0000 |
commit | 1eb4a079a00426a06a0b3aa029e8dd5606190897 (patch) | |
tree | a38877683ef4ca999c3114329bfac080a8028957 | |
parent | b4b566f2e27b30860a34ca722167ff748d29060d (diff) | |
download | mandoc-1eb4a079a00426a06a0b3aa029e8dd5606190897.tar.gz |
Remove <p> in favour of <div class="spacer">.
This is good because <p> is brittle: it can't appear within other block
macros.
This fixes a regression of the original HTML5 patch as noted by schwarze@
on the tech@ list, 14/8/2014.
-rw-r--r-- | html.c | 16 | ||||
-rw-r--r-- | html.h | 2 | ||||
-rw-r--r-- | man_html.c | 11 | ||||
-rw-r--r-- | mdoc_html.c | 10 |
4 files changed, 26 insertions, 13 deletions
@@ -68,7 +68,6 @@ static const struct htmldata htmltags[TAG_MAX] = { {"dt", HTML_CLRLINE}, /* TAG_DT */ {"dd", HTML_CLRLINE}, /* TAG_DD */ {"blockquote", HTML_CLRLINE}, /* TAG_BLOCKQUOTE */ - {"p", HTML_CLRLINE | HTML_NOSTACK | HTML_AUTOCLOSE}, /* TAG_P */ {"pre", HTML_CLRLINE }, /* TAG_PRE */ {"b", 0 }, /* TAG_B */ {"i", 0 }, /* TAG_I */ @@ -203,7 +202,8 @@ print_gen_head(struct html *h) "td.head-rtitle, td.foot-os { text-align: right; }\n" "td.head-vol { text-align: center; }\n" "table.foot td { width: 50%; }\n" - "table.head td { width: 33%; }\n"); + "table.head td { width: 33%; }\n" + "div.spacer { margin: 1em 0; }\n"); print_tagq(h, t); if (h->style) { @@ -623,6 +623,18 @@ print_stagq(struct html *h, const struct tag *suntil) } void +print_paragraph(struct html *h) +{ + struct tag *t; + struct htmlpair tag; + + PAIR_CLASS_INIT(&tag, "spacer"); + t = print_otag(h, TAG_DIV, 1, &tag); + print_tagq(h, t); +} + + +void bufinit(struct html *h) { @@ -44,7 +44,6 @@ enum htmltag { TAG_DT, TAG_DD, TAG_BLOCKQUOTE, - TAG_P, TAG_PRE, TAG_B, TAG_I, @@ -144,6 +143,7 @@ void print_text(struct html *, const char *); void print_tblclose(struct html *); void print_tbl(struct html *, const struct tbl_span *); void print_eqn(struct html *, const struct eqn *); +void print_paragraph(struct html *); #if __GNUC__ - 0 >= 4 __attribute__((__format__ (__printf__, 2, 3))) @@ -142,7 +142,7 @@ print_bvspace(struct html *h, const struct man_node *n) if (NULL == n->prev) return; - print_otag(h, TAG_P, 0, NULL); + print_paragraph(h); } void @@ -219,7 +219,7 @@ print_man_node(MAN_ARGS) * before printing the line's data. */ if ('\0' == *n->string) { - print_otag(h, TAG_P, 0, NULL); + print_paragraph(h); return; } @@ -538,7 +538,7 @@ man_IP_pre(MAN_ARGS) static int man_HP_pre(MAN_ARGS) { - struct htmlpair tag; + struct htmlpair tag[2]; struct roffsu su; const struct man_node *np; @@ -558,8 +558,9 @@ man_HP_pre(MAN_ARGS) bufcat_su(h, "margin-left", &su); su.scale = -su.scale; bufcat_su(h, "text-indent", &su); - PAIR_STYLE_INIT(&tag, h); - print_otag(h, TAG_P, 1, &tag); + PAIR_STYLE_INIT(&tag[0], h); + PAIR_CLASS_INIT(&tag[1], "spacer"); + print_otag(h, TAG_DIV, 2, tag); return(1); } diff --git a/mdoc_html.c b/mdoc_html.c index 87170dbe..a9f880f6 100644 --- a/mdoc_html.c +++ b/mdoc_html.c @@ -314,11 +314,11 @@ synopsis_pre(struct html *h, const struct mdoc_node *n) case MDOC_In: /* FALLTHROUGH */ case MDOC_Vt: - print_otag(h, TAG_P, 0, NULL); + print_paragraph(h); break; case MDOC_Ft: if (MDOC_Fn != n->tok && MDOC_Fo != n->tok) { - print_otag(h, TAG_P, 0, NULL); + print_paragraph(h); break; } /* FALLTHROUGH */ @@ -1156,7 +1156,7 @@ mdoc_bd_pre(MDOC_ARGS) break; } if ( ! comp) - print_otag(h, TAG_P, 0, NULL); + print_paragraph(h); return(1); } @@ -1562,7 +1562,7 @@ static int mdoc_pp_pre(MDOC_ARGS) { - print_otag(h, TAG_P, 0, NULL); + print_paragraph(h); return(0); } @@ -1890,7 +1890,7 @@ mdoc_rs_pre(MDOC_ARGS) return(1); if (n->prev && SEC_SEE_ALSO == n->sec) - print_otag(h, TAG_P, 0, NULL); + print_paragraph(h); PAIR_CLASS_INIT(&tag, "ref"); print_otag(h, TAG_SPAN, 1, &tag); |