version 1.254, 2019/03/03 13:02:11 |
version 1.255, 2019/04/30 15:53:00 |
Line 120 static void print_ctag(struct html *, struct tag *); |
|
Line 120 static void print_ctag(struct html *, struct tag *); |
|
static int print_escape(struct html *, char); |
static int print_escape(struct html *, char); |
static int print_encode(struct html *, const char *, const char *, int); |
static int print_encode(struct html *, const char *, const char *, int); |
static void print_href(struct html *, const char *, const char *, int); |
static void print_href(struct html *, const char *, const char *, int); |
|
static void print_metaf(struct html *); |
|
|
|
|
void * |
void * |
Line 222 print_gen_head(struct html *h) |
|
Line 223 print_gen_head(struct html *h) |
|
print_tagq(h, t); |
print_tagq(h, t); |
} |
} |
|
|
void |
int |
print_metaf(struct html *h, enum mandoc_esc deco) |
html_setfont(struct html *h, enum mandoc_esc font) |
{ |
{ |
enum htmlfont font; |
switch (font) { |
|
|
switch (deco) { |
|
case ESCAPE_FONTPREV: |
case ESCAPE_FONTPREV: |
font = h->metal; |
font = h->metal; |
break; |
break; |
case ESCAPE_FONTITALIC: |
case ESCAPE_FONTITALIC: |
font = HTMLFONT_ITALIC; |
|
break; |
|
case ESCAPE_FONTBOLD: |
case ESCAPE_FONTBOLD: |
font = HTMLFONT_BOLD; |
|
break; |
|
case ESCAPE_FONTBI: |
case ESCAPE_FONTBI: |
font = HTMLFONT_BI; |
|
break; |
|
case ESCAPE_FONTCW: |
case ESCAPE_FONTCW: |
font = HTMLFONT_CW; |
case ESCAPE_FONTROMAN: |
break; |
break; |
case ESCAPE_FONT: |
case ESCAPE_FONT: |
case ESCAPE_FONTROMAN: |
font = ESCAPE_FONTROMAN; |
font = HTMLFONT_NONE; |
|
break; |
break; |
default: |
default: |
return; |
return 0; |
} |
} |
|
h->metal = h->metac; |
|
h->metac = font; |
|
return 1; |
|
} |
|
|
|
static void |
|
print_metaf(struct html *h) |
|
{ |
if (h->metaf) { |
if (h->metaf) { |
print_tagq(h, h->metaf); |
print_tagq(h, h->metaf); |
h->metaf = NULL; |
h->metaf = NULL; |
} |
} |
|
switch (h->metac) { |
h->metal = h->metac; |
case ESCAPE_FONTITALIC: |
h->metac = font; |
|
|
|
switch (font) { |
|
case HTMLFONT_ITALIC: |
|
h->metaf = print_otag(h, TAG_I, ""); |
h->metaf = print_otag(h, TAG_I, ""); |
break; |
break; |
case HTMLFONT_BOLD: |
case ESCAPE_FONTBOLD: |
h->metaf = print_otag(h, TAG_B, ""); |
h->metaf = print_otag(h, TAG_B, ""); |
break; |
break; |
case HTMLFONT_BI: |
case ESCAPE_FONTBI: |
h->metaf = print_otag(h, TAG_B, ""); |
h->metaf = print_otag(h, TAG_B, ""); |
print_otag(h, TAG_I, ""); |
print_otag(h, TAG_I, ""); |
break; |
break; |
case HTMLFONT_CW: |
case ESCAPE_FONTCW: |
h->metaf = print_otag(h, TAG_SPAN, "c", "Li"); |
h->metaf = print_otag(h, TAG_SPAN, "c", "Li"); |
break; |
break; |
default: |
default: |
Line 479 print_encode(struct html *h, const char *p, const char |
|
Line 474 print_encode(struct html *h, const char *p, const char |
|
case ESCAPE_FONTROMAN: |
case ESCAPE_FONTROMAN: |
if (0 == norecurse) { |
if (0 == norecurse) { |
h->flags |= HTML_NOSPACE; |
h->flags |= HTML_NOSPACE; |
print_metaf(h, esc); |
if (html_setfont(h, esc)) |
|
print_metaf(h); |
h->flags &= ~HTML_NOSPACE; |
h->flags &= ~HTML_NOSPACE; |
} |
} |
continue; |
continue; |
Line 806 print_text(struct html *h, const char *word) |
|
Line 802 print_text(struct html *h, const char *word) |
|
print_word(h, " "); |
print_word(h, " "); |
} |
} |
|
|
assert(NULL == h->metaf); |
assert(h->metaf == NULL); |
switch (h->metac) { |
print_metaf(h); |
case HTMLFONT_ITALIC: |
print_indent(h); |
h->metaf = print_otag(h, TAG_I, ""); |
|
break; |
|
case HTMLFONT_BOLD: |
|
h->metaf = print_otag(h, TAG_B, ""); |
|
break; |
|
case HTMLFONT_BI: |
|
h->metaf = print_otag(h, TAG_B, ""); |
|
print_otag(h, TAG_I, ""); |
|
break; |
|
case HTMLFONT_CW: |
|
h->metaf = print_otag(h, TAG_SPAN, "c", "Li"); |
|
break; |
|
default: |
|
print_indent(h); |
|
break; |
|
} |
|
|
|
assert(word); |
|
if ( ! print_encode(h, word, NULL, 0)) { |
if ( ! print_encode(h, word, NULL, 0)) { |
if ( ! (h->flags & HTML_NONOSPACE)) |
if ( ! (h->flags & HTML_NONOSPACE)) |
h->flags &= ~HTML_NOSPACE; |
h->flags &= ~HTML_NOSPACE; |
Line 834 print_text(struct html *h, const char *word) |
|
Line 812 print_text(struct html *h, const char *word) |
|
} else |
} else |
h->flags |= HTML_NOSPACE | HTML_NONEWLINE; |
h->flags |= HTML_NOSPACE | HTML_NONEWLINE; |
|
|
if (h->metaf) { |
if (h->metaf != NULL) { |
print_tagq(h, h->metaf); |
print_tagq(h, h->metaf); |
h->metaf = NULL; |
h->metaf = NULL; |
} |
} |