version 1.188, 2015/10/06 18:32:19 |
version 1.192, 2016/01/04 12:45:29 |
Line 130 static void print_attr(struct html *, const char *, c |
|
Line 130 static void print_attr(struct html *, const char *, c |
|
|
|
|
|
void * |
void * |
html_alloc(const struct mchars *mchars, const struct manoutput *outopts) |
html_alloc(const struct manoutput *outopts) |
{ |
{ |
struct html *h; |
struct html *h; |
|
|
h = mandoc_calloc(1, sizeof(struct html)); |
h = mandoc_calloc(1, sizeof(struct html)); |
|
|
h->tags.head = NULL; |
h->tags.head = NULL; |
h->symtab = mchars; |
|
|
|
h->style = outopts->style; |
h->style = outopts->style; |
h->base_man = outopts->man; |
h->base_man = outopts->man; |
h->base_includes = outopts->includes; |
h->base_includes = outopts->includes; |
Line 218 print_metaf(struct html *h, enum mandoc_esc deco) |
|
Line 216 print_metaf(struct html *h, enum mandoc_esc deco) |
|
font = HTMLFONT_BI; |
font = HTMLFONT_BI; |
break; |
break; |
case ESCAPE_FONT: |
case ESCAPE_FONT: |
/* FALLTHROUGH */ |
|
case ESCAPE_FONTROMAN: |
case ESCAPE_FONTROMAN: |
font = HTMLFONT_NONE; |
font = HTMLFONT_NONE; |
break; |
break; |
Line 283 html_strlen(const char *cp) |
|
Line 280 html_strlen(const char *cp) |
|
case ESCAPE_ERROR: |
case ESCAPE_ERROR: |
return sz; |
return sz; |
case ESCAPE_UNICODE: |
case ESCAPE_UNICODE: |
/* FALLTHROUGH */ |
|
case ESCAPE_NUMBERED: |
case ESCAPE_NUMBERED: |
/* FALLTHROUGH */ |
|
case ESCAPE_SPECIAL: |
case ESCAPE_SPECIAL: |
/* FALLTHROUGH */ |
|
case ESCAPE_OVERSTRIKE: |
case ESCAPE_OVERSTRIKE: |
if (skip) |
if (skip) |
skip = 0; |
skip = 0; |
Line 322 print_escape(char c) |
|
Line 316 print_escape(char c) |
|
printf("""); |
printf("""); |
break; |
break; |
case ASCII_NBRSP: |
case ASCII_NBRSP: |
putchar('-'); |
printf(" "); |
break; |
break; |
case ASCII_HYPH: |
case ASCII_HYPH: |
putchar('-'); |
putchar('-'); |
/* FALLTHROUGH */ |
break; |
case ASCII_BREAK: |
case ASCII_BREAK: |
break; |
break; |
default: |
default: |
Line 371 print_encode(struct html *h, const char *p, int norecu |
|
Line 365 print_encode(struct html *h, const char *p, int norecu |
|
|
|
switch (esc) { |
switch (esc) { |
case ESCAPE_FONT: |
case ESCAPE_FONT: |
/* FALLTHROUGH */ |
|
case ESCAPE_FONTPREV: |
case ESCAPE_FONTPREV: |
/* FALLTHROUGH */ |
|
case ESCAPE_FONTBOLD: |
case ESCAPE_FONTBOLD: |
/* FALLTHROUGH */ |
|
case ESCAPE_FONTITALIC: |
case ESCAPE_FONTITALIC: |
/* FALLTHROUGH */ |
|
case ESCAPE_FONTBI: |
case ESCAPE_FONTBI: |
/* FALLTHROUGH */ |
|
case ESCAPE_FONTROMAN: |
case ESCAPE_FONTROMAN: |
if (0 == norecurse) |
if (0 == norecurse) |
print_metaf(h, esc); |
print_metaf(h, esc); |
Line 407 print_encode(struct html *h, const char *p, int norecu |
|
Line 396 print_encode(struct html *h, const char *p, int norecu |
|
continue; |
continue; |
break; |
break; |
case ESCAPE_SPECIAL: |
case ESCAPE_SPECIAL: |
c = mchars_spec2cp(h->symtab, seq, len); |
c = mchars_spec2cp(seq, len); |
if (c <= 0) |
if (c <= 0) |
continue; |
continue; |
break; |
break; |
|
|
bufcat_id(struct html *h, const char *src) |
bufcat_id(struct html *h, const char *src) |
{ |
{ |
|
|
/* Cf. <http://www.w3.org/TR/html4/types.html#h-6.2>. */ |
/* Cf. <http://www.w3.org/TR/html5/dom.html#the-id-attribute>. */ |
|
|
while ('\0' != *src) |
for (; '\0' != *src; src++) |
bufcat_fmt(h, "%.2x", *src++); |
bufncat(h, *src == ' ' ? "_" : src, 1); |
} |
} |