]> git.cameronkatri.com Git - mandoc.git/blobdiff - html.c
Use the correct Unicode value for the zero-width space, which means that
[mandoc.git] / html.c
diff --git a/html.c b/html.c
index 08e2086c05ecd04a424d9c2bc232a975e2ef34ae..45471fe3b050c7456a57abd8ea68aee51d4c3008 100644 (file)
--- a/html.c
+++ b/html.c
@@ -1,4 +1,4 @@
-/*     $Id: html.c,v 1.145 2011/05/18 23:59:08 kristaps Exp $ */
+/*     $Id: html.c,v 1.147 2011/05/24 21:40:14 kristaps Exp $ */
 /*
  * Copyright (c) 2008, 2009, 2010, 2011 Kristaps Dzonsons <kristaps@bsd.lv>
  * Copyright (c) 2011 Ingo Schwarze <schwarze@openbsd.org>
@@ -108,8 +108,6 @@ static      const char      *const roffscales[SCALE_MAX] = {
 };
 
 static void     bufncat(struct html *, const char *, size_t);
-static void     print_spec(struct html *, const char *, size_t);
-static void     print_res(struct html *, const char *, size_t);
 static void     print_ctag(struct html *, enum htmltag);
 static int      print_encode(struct html *, const char *, int);
 static void     print_metaf(struct html *, enum mandoc_esc);
@@ -218,45 +216,6 @@ print_gen_head(struct html *h)
        }
 }
 
-static void
-print_spec(struct html *h, const char *p, size_t len)
-{
-       int              cp;
-       const char      *rhs;
-       size_t           sz;
-
-       if ((cp = mchars_spec2cp(h->symtab, p, len)) > 0) {
-               printf("&#%d;", cp);
-               return;
-       } else if (-1 == cp && 1 == len) {
-               fwrite(p, 1, len, stdout);
-               return;
-       } else if (-1 == cp)
-               return;
-
-       if (NULL != (rhs = mchars_spec2str(h->symtab, p, len, &sz)))
-               fwrite(rhs, 1, sz, stdout);
-}
-
-
-static void
-print_res(struct html *h, const char *p, size_t len)
-{
-       int              cp;
-       const char      *rhs;
-       size_t           sz;
-
-       if ((cp = mchars_res2cp(h->symtab, p, len)) > 0) {
-               printf("&#%d;", cp);
-               return;
-       } else if (-1 == cp)
-               return;
-
-       if (NULL != (rhs = mchars_res2str(h->symtab, p, len, &sz)))
-               fwrite(rhs, 1, sz, stdout);
-}
-
-
 static void
 print_metaf(struct html *h, enum mandoc_esc deco)
 {
@@ -321,8 +280,6 @@ html_strlen(const char *cp)
                        /* FALLTHROUGH */
                case (ESCAPE_NUMBERED):
                        /* FALLTHROUGH */
-               case (ESCAPE_PREDEF):
-                       /* FALLTHROUGH */
                case (ESCAPE_SPECIAL):
                        sz++;
                        break;
@@ -388,11 +345,12 @@ print_encode(struct html *h, const char *p, int norecurse)
                        if ('\0' != c)
                                putchar(c);
                        break;
-               case (ESCAPE_PREDEF):
-                       print_res(h, seq, len);
-                       break;
                case (ESCAPE_SPECIAL):
-                       print_spec(h, seq, len);
+                       c = mchars_spec2cp(h->symtab, seq, len);
+                       if (c > 0)
+                               printf("&#%d;", c);
+                       else if (-1 == c && 1 == len)
+                               putchar((int)*seq);
                        break;
                case (ESCAPE_FONT):
                        /* FALLTHROUGH */