version 1.20, 2017/05/05 13:17:55 |
version 1.22, 2017/05/30 16:31:29 |
Line 222 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 */ |
}; |
}; |
Line 323 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_sp: |
|
process_children = md_pre_Pp(n); |
|
break; |
default: |
default: |
process_children = 0; |
process_children = 0; |
break; |
break; |
Line 1304 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 1328 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; |
} |
} |