=================================================================== RCS file: /cvs/mandoc/html.c,v retrieving revision 1.142 retrieving revision 1.145 diff -u -p -r1.142 -r1.145 --- mandoc/html.c 2011/05/17 11:34:31 1.142 +++ mandoc/html.c 2011/05/18 23:59:08 1.145 @@ -1,4 +1,4 @@ -/* $Id: html.c,v 1.142 2011/05/17 11:34:31 kristaps Exp $ */ +/* $Id: html.c,v 1.145 2011/05/18 23:59:08 kristaps Exp $ */ /* * Copyright (c) 2008, 2009, 2010, 2011 Kristaps Dzonsons * Copyright (c) 2011 Ingo Schwarze @@ -272,6 +272,8 @@ print_metaf(struct html *h, enum mandoc_esc deco) case (ESCAPE_FONTBOLD): font = HTMLFONT_BOLD; break; + case (ESCAPE_FONT): + /* FALLTHROUGH */ case (ESCAPE_FONTROMAN): font = HTMLFONT_NONE; break; @@ -315,6 +317,8 @@ html_strlen(const char *cp) switch (mandoc_escape(&cp, &seq, &ssz)) { case (ESCAPE_ERROR): return(sz); + case (ESCAPE_UNICODE): + /* FALLTHROUGH */ case (ESCAPE_NUMBERED): /* FALLTHROUGH */ case (ESCAPE_PREDEF): @@ -373,6 +377,12 @@ print_encode(struct html *h, const char *p, int norecu break; switch (esc) { + case (ESCAPE_UNICODE): + /* Skip passed "u" header. */ + c = mchars_num2uc(seq + 1, len - 1); + if ('\0' != c) + printf("&#x%x;", c); + break; case (ESCAPE_NUMBERED): c = mchars_num2char(seq, len); if ('\0' != c) @@ -384,6 +394,8 @@ print_encode(struct html *h, const char *p, int norecu case (ESCAPE_SPECIAL): print_spec(h, seq, len); break; + case (ESCAPE_FONT): + /* FALLTHROUGH */ case (ESCAPE_FONTPREV): /* FALLTHROUGH */ case (ESCAPE_FONTBOLD): @@ -656,6 +668,7 @@ buffmt_includes(struct html *h, const char *name) pp = h->base_includes; + bufinit(h); while (NULL != (p = strchr(pp, '%'))) { bufncat(h, pp, (size_t)(p - pp)); switch (*(p + 1)) { @@ -680,7 +693,7 @@ buffmt_man(struct html *h, pp = h->base_man; - /* LINTED */ + bufinit(h); while (NULL != (p = strchr(pp, '%'))) { bufncat(h, pp, (size_t)(p - pp)); switch (*(p + 1)) { @@ -718,8 +731,6 @@ bufcat_id(struct html *h, const char *src) /* Cf. . */ - if (0 == h->buflen) - bufcat(h, "#x"); while ('\0' != *src) bufcat_fmt(h, "%.2x", *src++); }