[BACK]Return to html.c CVS log [TXT][DIR] Up to [cvsweb.bsd.lv] / mandoc

Diff for /mandoc/html.c between version 1.173 and 1.178

version 1.173, 2014/09/28 11:33:15 version 1.178, 2014/10/27 13:31:04
Line 1 
Line 1 
 /*      $Id$ */  /*      $Id$ */
 /*  /*
  * Copyright (c) 2008, 2009, 2010, 2011, 2014 Kristaps Dzonsons <kristaps@bsd.lv>   * Copyright (c) 2008-2011, 2014 Kristaps Dzonsons <kristaps@bsd.lv>
  * Copyright (c) 2011, 2012, 2013, 2014 Ingo Schwarze <schwarze@openbsd.org>   * Copyright (c) 2011, 2012, 2013, 2014 Ingo Schwarze <schwarze@openbsd.org>
  *   *
  * Permission to use, copy, modify, and distribute this software for any   * Permission to use, copy, modify, and distribute this software for any
Line 87  static const struct htmldata htmltags[TAG_MAX] = {
Line 87  static const struct htmldata htmltags[TAG_MAX] = {
         {"mtable",      0}, /* TAG_MTABLE */          {"mtable",      0}, /* TAG_MTABLE */
         {"mtr",         0}, /* TAG_MTR */          {"mtr",         0}, /* TAG_MTR */
         {"mtd",         0}, /* TAG_MTD */          {"mtd",         0}, /* TAG_MTD */
           {"munderover",  0}, /* TAG_MUNDEROVER */
           {"munder",      0}, /* TAG_MUNDER*/
           {"mover",       0}, /* TAG_MOVER*/
 };  };
   
 static  const char      *const htmlattrs[ATTR_MAX] = {  static  const char      *const htmlattrs[ATTR_MAX] = {
Line 102  static const char *const htmlattrs[ATTR_MAX] = {
Line 105  static const char *const htmlattrs[ATTR_MAX] = {
         "charset", /* ATTR_CHARSET */          "charset", /* ATTR_CHARSET */
         "open", /* ATTR_OPEN */          "open", /* ATTR_OPEN */
         "close", /* ATTR_CLOSE */          "close", /* ATTR_CLOSE */
           "mathvariant", /* ATTR_MATHVARIANT */
 };  };
   
 static  const char      *const roffscales[SCALE_MAX] = {  static  const char      *const roffscales[SCALE_MAX] = {
Line 433  print_encode(struct html *h, const char *p, int norecu
Line 437  print_encode(struct html *h, const char *p, int norecu
                 case ESCAPE_UNICODE:                  case ESCAPE_UNICODE:
                         /* Skip past "u" header. */                          /* Skip past "u" header. */
                         c = mchars_num2uc(seq + 1, len - 1);                          c = mchars_num2uc(seq + 1, len - 1);
                         if ('\0' != c)  
                                 printf("&#x%x;", c);                          /*
                            * XXX Security warning:
                            * For now, forbid Unicode obfuscation of ASCII
                            * characters.  An audit of the callers is
                            * required before this can be removed.
                            */
   
                           if (c < 0x80)
                                   c = 0xFFFD;
   
                           printf("&#x%x;", c);
                         break;                          break;
                 case ESCAPE_NUMBERED:                  case ESCAPE_NUMBERED:
                         c = mchars_num2char(seq, len);                          c = mchars_num2char(seq, len);
Line 443  print_encode(struct html *h, const char *p, int norecu
Line 457  print_encode(struct html *h, const char *p, int norecu
                         break;                          break;
                 case ESCAPE_SPECIAL:                  case ESCAPE_SPECIAL:
                         c = mchars_spec2cp(h->symtab, seq, len);                          c = mchars_spec2cp(h->symtab, seq, len);
                         if (c > 0)                          if (c <= 0)
                                   break;
                           if (c < 0x20 || c > 0x7e)
                                 printf("&#%d;", c);                                  printf("&#%d;", c);
                         else if (-1 == c && 1 == len &&                          else if ( ! print_escape(c))
                             !print_escape(*seq))                                  putchar(c);
                                 putchar((int)*seq);  
                         break;                          break;
                 case ESCAPE_NOSPACE:                  case ESCAPE_NOSPACE:
                         if ('\0' == *p)                          if ('\0' == *p)

Legend:
Removed from v.1.173  
changed lines
  Added in v.1.178

CVSweb