=================================================================== RCS file: /cvsrepo/anoncvs/cvs/src/usr.bin/mandoc/html.c,v retrieving revision 1.19 retrieving revision 1.20 diff -c -r1.19 -r1.20 *** src/usr.bin/mandoc/html.c 2010/12/22 00:33:25 1.19 --- src/usr.bin/mandoc/html.c 2010/12/25 13:23:03 1.20 *************** *** 1,4 **** ! /* $Id: html.c,v 1.19 2010/12/22 00:33:25 schwarze Exp $ */ /* * Copyright (c) 2008, 2009, 2010 Kristaps Dzonsons * --- 1,4 ---- ! /* $Id: html.c,v 1.20 2010/12/25 13:23:03 schwarze Exp $ */ /* * Copyright (c) 2008, 2009, 2010 Kristaps Dzonsons * *************** *** 68,82 **** {"pre", HTML_CLRLINE }, /* TAG_PRE */ {"b", 0 }, /* TAG_B */ {"i", 0 }, /* TAG_I */ ! {"u", 0 }, /* TAG_U */ }; - static const char *const htmlfonts[HTMLFONT_MAX] = { - "roman", - "bold", - "italic" - }; - static const char *const htmlattrs[ATTR_MAX] = { "http-equiv", /* ATTR_HTTPEQUIV */ "content", /* ATTR_CONTENT */ --- 68,77 ---- {"pre", HTML_CLRLINE }, /* TAG_PRE */ {"b", 0 }, /* TAG_B */ {"i", 0 }, /* TAG_I */ ! {"code", 0 }, /* TAG_CODE */ ! {"small", 0 }, /* TAG_SMALL */ }; static const char *const htmlattrs[ATTR_MAX] = { "http-equiv", /* ATTR_HTTPEQUIV */ "content", /* ATTR_CONTENT */ *************** *** 252,276 **** } - struct tag * - print_ofont(struct html *h, enum htmlfont font) - { - struct htmlpair tag; - - h->metal = h->metac; - h->metac = font; - - /* FIXME: DECO_ROMAN should just close out preexisting. */ - - if (h->metaf && h->tags.head == h->metaf) - print_tagq(h, h->metaf); - - PAIR_CLASS_INIT(&tag, htmlfonts[font]); - h->metaf = print_otag(h, TAG_SPAN, 1, &tag); - return(h->metaf); - } - - static void print_metaf(struct html *h, enum roffdeco deco) { --- 247,252 ---- *************** *** 294,300 **** /* NOTREACHED */ } ! (void)print_ofont(h, font); } --- 270,287 ---- /* NOTREACHED */ } ! if (h->metaf) { ! print_tagq(h, h->metaf); ! h->metaf = NULL; ! } ! ! h->metal = h->metac; ! h->metac = font; ! ! if (HTMLFONT_NONE != font) ! h->metaf = HTMLFONT_BOLD == font ? ! print_otag(h, TAG_B, 0, NULL) : ! print_otag(h, TAG_I, 0, NULL); } *************** *** 482,488 **** { if (HTML_XHTML_1_0_STRICT == h->type) ! printf(""); } --- 469,475 ---- { if (HTML_XHTML_1_0_STRICT == h->type) ! puts(""); } *************** *** 549,558 **** --- 536,556 ---- printf(" "); } + assert(NULL == h->metaf); + if (HTMLFONT_NONE != h->metac) + h->metaf = HTMLFONT_BOLD == h->metac ? + print_otag(h, TAG_B, 0, NULL) : + print_otag(h, TAG_I, 0, NULL); + assert(word); if ( ! print_encode(h, word, 0)) if ( ! (h->flags & HTML_NONOSPACE)) h->flags &= ~HTML_NOSPACE; + + if (h->metaf) { + print_tagq(h, h->metaf); + h->metaf = NULL; + } h->flags &= ~HTML_IGNDELIM;