=================================================================== RCS file: /cvs/mandoc/man_html.c,v retrieving revision 1.89 retrieving revision 1.92 diff -u -p -r1.89 -r1.92 --- mandoc/man_html.c 2012/11/17 00:26:33 1.89 +++ mandoc/man_html.c 2014/03/30 19:47:48 1.92 @@ -1,6 +1,7 @@ -/* $Id: man_html.c,v 1.89 2012/11/17 00:26:33 schwarze Exp $ */ +/* $Id: man_html.c,v 1.92 2014/03/30 19:47:48 schwarze Exp $ */ /* * Copyright (c) 2008-2012 Kristaps Dzonsons + * Copyright (c) 2013, 2014 Ingo Schwarze * * Permission to use, copy, modify, and distribute this software for any * purpose with or without fee is hereby granted, provided that the above @@ -70,6 +71,7 @@ static int man_RS_pre(MAN_ARGS); static int man_SH_pre(MAN_ARGS); static int man_SM_pre(MAN_ARGS); static int man_SS_pre(MAN_ARGS); +static int man_UR_pre(MAN_ARGS); static int man_alt_pre(MAN_ARGS); static int man_br_pre(MAN_ARGS); static int man_ign_pre(MAN_ARGS); @@ -115,6 +117,9 @@ static const struct htmlman mans[MAN_MAX] = { { man_OP_pre, NULL }, /* OP */ { man_literal_pre, NULL }, /* EX */ { man_literal_pre, NULL }, /* EE */ + { man_UR_pre, NULL }, /* UR */ + { NULL, NULL }, /* UE */ + { man_ign_pre, NULL }, /* ll */ }; /* @@ -549,10 +554,15 @@ man_IP_pre(MAN_ARGS) /* For TP, only print next-line header elements. */ - if (MAN_TP == n->tok) - for (nn = n->child; nn; nn = nn->next) - if (nn->line > n->line) - print_man_node(man, nn, mh, h); + if (MAN_TP == n->tok) { + nn = n->child; + while (NULL != nn && 0 == (MAN_LINE & nn->flags)) + nn = nn->next; + while (NULL != nn) { + print_man_node(man, nn, mh, h); + nn = nn->next; + } + } return(0); } @@ -687,4 +697,28 @@ man_RS_pre(MAN_ARGS) PAIR_STYLE_INIT(&tag, h); print_otag(h, TAG_DIV, 1, &tag); return(1); +} + +/* ARGSUSED */ +static int +man_UR_pre(MAN_ARGS) +{ + struct htmlpair tag[2]; + + n = n->child; + assert(MAN_HEAD == n->type); + if (n->nchild) { + assert(MAN_TEXT == n->child->type); + PAIR_CLASS_INIT(&tag[0], "link-ext"); + PAIR_HREF_INIT(&tag[1], n->child->string); + print_otag(h, TAG_A, 2, tag); + } + + assert(MAN_BODY == n->next->type); + if (n->next->nchild) + n = n->next; + + print_man_nodelist(man, n->child, mh, h); + + return(0); }