version 1.1, 2017/03/03 14:23:23 |
version 1.3, 2017/03/06 14:58:10 |
Line 220 static const struct md_act md_acts[MDOC_MAX + 1] = { |
|
Line 220 static const struct md_act md_acts[MDOC_MAX + 1] = { |
|
{ NULL, NULL, md_post_pc, NULL, NULL }, /* %Q */ |
{ NULL, NULL, md_post_pc, NULL, NULL }, /* %Q */ |
{ NULL, md_pre_br, NULL, NULL, NULL }, /* br */ |
{ NULL, md_pre_br, NULL, NULL, NULL }, /* br */ |
{ NULL, md_pre_Pp, NULL, NULL, NULL }, /* sp */ |
{ NULL, md_pre_Pp, NULL, NULL, NULL }, /* sp */ |
{ NULL, NULL, 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 */ |
{ NULL, NULL, NULL, NULL, NULL }, /* ll */ |
{ NULL, NULL, NULL, NULL, NULL }, /* ROOT */ |
{ NULL, NULL, NULL, NULL, NULL }, /* ROOT */ |
|
|
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; |
|
const unsigned char *s; |
|
|
if ((link = n->child) == NULL) |
if ((link = n->child) == NULL) |
return 0; |
return 0; |
Line 1251 md_pre_Lk(struct roff_node *n) |
|
Line 1252 md_pre_Lk(struct roff_node *n) |
|
} else |
} else |
md_rawword("<"); |
md_rawword("<"); |
|
|
|
for (s = link->string; *s != '\0'; s++) { |
|
if (strchr("%)<>", *s) != NULL) { |
|
printf("%%%2.2hhX", *s); |
|
outcount += 3; |
|
} else { |
|
putchar(*s); |
|
outcount++; |
|
} |
|
} |
|
|
outflags &= ~MD_spc; |
outflags &= ~MD_spc; |
md_word(link->string); |
|
outflags &= ~MD_spc; |
|
md_rawword(link->next == NULL ? ">" : ")"); |
md_rawword(link->next == NULL ? ">" : ")"); |
return 0; |
return 0; |
} |
} |
Line 1419 md_pre_Xr(struct roff_node *n) |
|
Line 1428 md_pre_Xr(struct roff_node *n) |
|
static int |
static int |
md_pre__T(struct roff_node *n) |
md_pre__T(struct roff_node *n) |
{ |
{ |
if (n->parent != NULL && n->parent->tok == MDOC_Rs && |
if (n->parent->tok == MDOC_Rs && n->parent->norm->Rs.quote_T) |
n->parent->norm->Rs.quote_T) |
|
md_word("\""); |
md_word("\""); |
else |
else |
md_rawword("*"); |
md_rawword("*"); |
|
|
md_post__T(struct roff_node *n) |
md_post__T(struct roff_node *n) |
{ |
{ |
outflags &= ~MD_spc; |
outflags &= ~MD_spc; |
if (n->parent != NULL && n->parent->tok == MDOC_Rs && |
if (n->parent->tok == MDOC_Rs && n->parent->norm->Rs.quote_T) |
n->parent->norm->Rs.quote_T) |
|
md_word("\""); |
md_word("\""); |
else |
else |
md_rawword("*"); |
md_rawword("*"); |