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

Diff for /mandoc/mdoc_markdown.c between version 1.19 and 1.22

version 1.19, 2017/05/05 02:06:19 version 1.22, 2017/05/30 16:31:29
Line 19 
Line 19 
 #include <assert.h>  #include <assert.h>
 #include <ctype.h>  #include <ctype.h>
 #include <stdio.h>  #include <stdio.h>
 #include <stdlib.h>  
 #include <string.h>  #include <string.h>
   
 #include "mandoc_aux.h"  #include "mandoc_aux.h"
Line 223  static const struct md_act __md_acts[MDOC_MAX - MDOC_D
Line 222  static const struct md_act __md_acts[MDOC_MAX - MDOC_D
         { md_cond_body, md_pre_En, md_post_En, NULL, NULL }, /* En */          { md_cond_body, md_pre_En, md_post_En, NULL, NULL }, /* En */
         { NULL, NULL, NULL, NULL, NULL }, /* Dx */          { NULL, NULL, NULL, NULL, NULL }, /* Dx */
         { NULL, NULL, md_post_pc, NULL, NULL }, /* %Q */          { NULL, NULL, md_post_pc, NULL, NULL }, /* %Q */
         { NULL, md_pre_Pp, NULL, NULL, NULL }, /* sp */  
         { NULL, md_pre_Lk, md_post_pc, NULL, NULL }, /* %U */          { NULL, md_pre_Lk, md_post_pc, NULL, NULL }, /* %U */
         { NULL, NULL, NULL, NULL, NULL }, /* Ta */          { NULL, NULL, NULL, NULL, NULL }, /* Ta */
         { NULL, NULL, NULL, NULL, NULL }, /* ll */  
 };  };
 static  const struct md_act *const md_acts = __md_acts - MDOC_Dd;  static  const struct md_act *const md_acts = __md_acts - MDOC_Dd;
   
Line 325  md_node(struct roff_node *n)
Line 322  md_node(struct roff_node *n)
                 case ROFF_br:                  case ROFF_br:
                         process_children = md_pre_br(n);                          process_children = md_pre_br(n);
                         break;                          break;
                 case ROFF_ft:                  case ROFF_sp:
                         process_children = 0;                          process_children = md_pre_Pp(n);
                         break;                          break;
                 default:                  default:
                         abort();                          process_children = 0;
                           break;
                 }                  }
         } else {          } else {
                 assert(n->tok >= MDOC_Dd && n->tok < MDOC_MAX);                  assert(n->tok >= MDOC_Dd && n->tok < MDOC_MAX);
Line 1308  md_uri(const char *s)
Line 1306  md_uri(const char *s)
 static int  static int
 md_pre_Lk(struct roff_node *n)  md_pre_Lk(struct roff_node *n)
 {  {
         const struct roff_node *link, *descr;          const struct roff_node *link, *descr, *punct;
   
         if ((link = n->child) == NULL)          if ((link = n->child) == NULL)
                 return 0;                  return 0;
   
           /* Find beginning of trailing punctuation. */
           punct = n->last;
           while (punct != link && punct->flags & NODE_DELIMC)
                   punct = punct->prev;
           punct = punct->next;
   
         /* Link text. */          /* Link text. */
         descr = link->next;          descr = link->next;
         if (descr == NULL || descr->flags & NODE_DELIMC)          if (descr == punct)
                 descr = link;  /* no text */                  descr = link;  /* no text */
         md_rawword("[");          md_rawword("[");
         outflags &= ~MD_spc;          outflags &= ~MD_spc;
         do {          do {
                 md_word(descr->string);                  md_word(descr->string);
                 descr = descr->next;                  descr = descr->next;
         } while (descr != NULL && !(descr->flags & NODE_DELIMC));          } while (descr != punct);
         outflags &= ~MD_spc;          outflags &= ~MD_spc;
   
         /* Link target. */          /* Link target. */
Line 1332  md_pre_Lk(struct roff_node *n)
Line 1336  md_pre_Lk(struct roff_node *n)
         md_rawword(")");          md_rawword(")");
   
         /* Trailing punctuation. */          /* Trailing punctuation. */
         while (descr != NULL) {          while (punct != NULL) {
                 md_word(descr->string);                  md_word(punct->string);
                 descr = descr->next;                  punct = punct->next;
         }          }
         return 0;          return 0;
 }  }

Legend:
Removed from v.1.19  
changed lines
  Added in v.1.22

CVSweb