=================================================================== RCS file: /cvs/mandoc/html.c,v retrieving revision 1.102 retrieving revision 1.104 diff -u -p -r1.102 -r1.104 --- mandoc/html.c 2010/06/19 20:46:27 1.102 +++ mandoc/html.c 2010/07/06 11:10:53 1.104 @@ -1,4 +1,4 @@ -/* $Id: html.c,v 1.102 2010/06/19 20:46:27 kristaps Exp $ */ +/* $Id: html.c,v 1.104 2010/07/06 11:10:53 kristaps Exp $ */ /* * Copyright (c) 2008, 2009 Kristaps Dzonsons * @@ -484,11 +484,11 @@ print_doctype(struct html *h) void -print_text(struct html *h, const char *p) +print_text(struct html *h, const char *word) { - if (*p && 0 == *(p + 1)) - switch (*p) { + if (word[0] && '\0' == word[1]) + switch (word[0]) { case('.'): /* FALLTHROUGH */ case(','): @@ -514,16 +514,16 @@ print_text(struct html *h, const char *p) if ( ! (h->flags & HTML_NOSPACE)) putchar(' '); - assert(p); - if ( ! print_encode(h, p, 0)) + assert(word); + if ( ! print_encode(h, word, 0)) h->flags &= ~HTML_NOSPACE; /* * Note that we don't process the pipe: the parser sees it as * punctuation, but we don't in terms of typography. */ - if (*p && 0 == *(p + 1)) - switch (*p) { + if (word[0] && '\0' == word[1]) + switch (word[0]) { case('('): /* FALLTHROUGH */ case('['): @@ -718,11 +718,11 @@ bufcat_su(struct html *h, const char *p, const struct break; } - if (su->pt) - buffmt(h, "%s: %f%s;", p, v, u); - else - /* LINTED */ - buffmt(h, "%s: %d%s;", p, (int)v, u); + /* + * XXX: the CSS spec isn't clear as to which types accept + * integer or real numbers, so we just make them all decimals. + */ + buffmt(h, "%s: %.2f%s;", p, v, u); }