=================================================================== RCS file: /cvs/mandoc/html.c,v retrieving revision 1.99 retrieving revision 1.100 diff -u -p -r1.99 -r1.100 --- mandoc/html.c 2010/04/12 19:45:39 1.99 +++ mandoc/html.c 2010/05/25 12:37:20 1.100 @@ -1,4 +1,4 @@ -/* $Id: html.c,v 1.99 2010/04/12 19:45:39 kristaps Exp $ */ +/* $Id: html.c,v 1.100 2010/05/25 12:37:20 kristaps Exp $ */ /* * Copyright (c) 2008, 2009 Kristaps Dzonsons * @@ -29,6 +29,7 @@ #include #include +#include "mandoc.h" #include "out.h" #include "chars.h" #include "html.h" @@ -296,11 +297,12 @@ print_encode(struct html *h, const char *p, int norecu int len, nospace; const char *seq; enum roffdeco deco; + static const char rejs[6] = { '\\', '<', '>', '&', ASCII_HYPH, '\0' }; nospace = 0; for (; *p; p++) { - sz = strcspn(p, "\\<>&"); + sz = strcspn(p, rejs); fwrite(p, 1, sz, stdout); p += /* LINTED */ @@ -315,6 +317,15 @@ print_encode(struct html *h, const char *p, int norecu } else if ('&' == *p) { printf("&"); continue; + } else if (ASCII_HYPH == *p) { + /* + * Note: "soft hyphens" aren't graphically + * displayed when not breaking the text; we want + * them to be displayed. + */ + /*printf("­");*/ + putchar('-'); + continue; } else if ('\0' == *p) break; @@ -443,21 +454,9 @@ print_gen_decls(struct html *h) static void print_xmltype(struct html *h) { - const char *decl; - switch (h->type) { - case (HTML_XHTML_1_0_STRICT): - decl = ""; - break; - default: - decl = NULL; - break; - } - - if (NULL == decl) - return; - - printf("%s\n", decl); + if (HTML_XHTML_1_0_STRICT == h->type) + printf(""); }