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

Diff for /mandoc/html.c between version 1.275 and 1.279

version 1.275, 2021/09/09 14:47:24 version 1.279, 2022/08/09 11:23:11
Line 2 
Line 2 
 /*  /*
  * Copyright (c) 2008-2011, 2014 Kristaps Dzonsons <kristaps@bsd.lv>   * Copyright (c) 2008-2011, 2014 Kristaps Dzonsons <kristaps@bsd.lv>
  * Copyright (c) 2011-2015, 2017-2021 Ingo Schwarze <schwarze@openbsd.org>   * Copyright (c) 2011-2015, 2017-2021 Ingo Schwarze <schwarze@openbsd.org>
    * Copyright (c) 2022 Anna Vyalkova <cyber@sysrq.in>
  *   *
  * Permission to use, copy, modify, and distribute this software for any   * Permission to use, copy, modify, and distribute this software for any
  * purpose with or without fee is hereby granted, provided that the above   * purpose with or without fee is hereby granted, provided that the above
Line 67  static const struct htmldata htmltags[TAG_MAX] = {
Line 68  static const struct htmldata htmltags[TAG_MAX] = {
         {"style",       HTML_NLALL | HTML_INDENT},          {"style",       HTML_NLALL | HTML_INDENT},
         {"title",       HTML_NLAROUND},          {"title",       HTML_NLAROUND},
         {"body",        HTML_NLALL},          {"body",        HTML_NLALL},
           {"main",        HTML_NLALL},
         {"div",         HTML_NLAROUND},          {"div",         HTML_NLAROUND},
         {"section",     HTML_NLALL},          {"section",     HTML_NLALL},
           {"nav",         HTML_NLALL},
         {"table",       HTML_NLALL | HTML_INDENT},          {"table",       HTML_NLALL | HTML_INDENT},
         {"tr",          HTML_NLALL | HTML_INDENT},          {"tr",          HTML_NLALL | HTML_INDENT},
         {"td",          HTML_NLAROUND},          {"td",          HTML_NLAROUND},
Line 78  static const struct htmldata htmltags[TAG_MAX] = {
Line 81  static const struct htmldata htmltags[TAG_MAX] = {
         {"dl",          HTML_NLALL | HTML_INDENT},          {"dl",          HTML_NLALL | HTML_INDENT},
         {"dt",          HTML_NLAROUND},          {"dt",          HTML_NLAROUND},
         {"dd",          HTML_NLAROUND | HTML_INDENT},          {"dd",          HTML_NLAROUND | HTML_INDENT},
         {"h1",          HTML_TOPHRASE | HTML_NLAROUND},  
         {"h2",          HTML_TOPHRASE | HTML_NLAROUND},          {"h2",          HTML_TOPHRASE | HTML_NLAROUND},
           {"h3",          HTML_TOPHRASE | HTML_NLAROUND},
         {"p",           HTML_TOPHRASE | HTML_NLAROUND | HTML_INDENT},          {"p",           HTML_TOPHRASE | HTML_NLAROUND | HTML_INDENT},
         {"pre",         HTML_TOPHRASE | HTML_NLAROUND | HTML_NOINDENT},          {"pre",         HTML_TOPHRASE | HTML_NLAROUND | HTML_NOINDENT},
         {"a",           HTML_INPHRASE | HTML_TOPHRASE},          {"a",           HTML_INPHRASE | HTML_TOPHRASE},
Line 400  html_make_id(const struct roff_node *n, int unique)
Line 403  html_make_id(const struct roff_node *n, int unique)
          * In addition, reserve '~' for ordinal suffixes.           * In addition, reserve '~' for ordinal suffixes.
          */           */
   
         for (cp = buf; *cp != '\0'; cp++)          for (cp = buf; *cp != '\0'; cp++) {
                 if (isalnum((unsigned char)*cp) == 0 &&                  if (*cp == ASCII_HYPH)
                           *cp = '-';
                   else if (isalnum((unsigned char)*cp) == 0 &&
                     strchr("!$&'()*+,-./:;=?@_", *cp) == NULL)                      strchr("!$&'()*+,-./:;=?@_", *cp) == NULL)
                         *cp = '_';                          *cp = '_';
           }
   
         if (unique == 0)          if (unique == 0)
                 return buf;                  return buf;
Line 707  print_otag(struct html *h, enum htmltag tag, const cha
Line 713  print_otag(struct html *h, enum htmltag tag, const cha
                         break;                          break;
                 case 'i':                  case 'i':
                         attr = "id";                          attr = "id";
                           break;
                   case 'r':
                           attr = "role";
                         break;                          break;
                 case '?':                  case '?':
                         attr = arg1;                          attr = arg1;

Legend:
Removed from v.1.275  
changed lines
  Added in v.1.279

CVSweb