version 1.89, 2009/11/15 06:45:31 |
version 1.91, 2009/11/16 08:46:58 |
Line 66 static const struct htmldata htmltags[TAG_MAX] = { |
|
Line 66 static const struct htmldata htmltags[TAG_MAX] = { |
|
{"base", HTML_CLRLINE | HTML_NOSTACK}, /* TAG_BASE */ |
{"base", HTML_CLRLINE | HTML_NOSTACK}, /* TAG_BASE */ |
}; |
}; |
|
|
|
static const char *const htmlfonts[HTMLFONT_MAX] = { |
|
"roman", |
|
"bold", |
|
"italic" |
|
}; |
|
|
static const char *const htmlattrs[ATTR_MAX] = { |
static const char *const htmlattrs[ATTR_MAX] = { |
"http-equiv", |
"http-equiv", |
"content", |
"content", |
Line 221 print_res(struct html *h, const char *p, size_t len) |
|
Line 227 print_res(struct html *h, const char *p, size_t len) |
|
} |
} |
|
|
|
|
|
struct tag * |
|
print_ofont(struct html *h, enum htmlfont font) |
|
{ |
|
struct htmlpair tag; |
|
|
|
h->metal = h->metac; |
|
h->metac = font; |
|
|
|
/* FIXME: DECO_ROMAN should just close out preexisting. */ |
|
|
|
if (h->metaf && h->tags.head == h->metaf) |
|
print_tagq(h, h->metaf); |
|
|
|
PAIR_CLASS_INIT(&tag, htmlfonts[font]); |
|
h->metaf = print_otag(h, TAG_SPAN, 1, &tag); |
|
return(h->metaf); |
|
} |
|
|
|
|
static void |
static void |
print_metaf(struct html *h, enum roffdeco deco) |
print_metaf(struct html *h, enum roffdeco deco) |
{ |
{ |
const char *class; |
enum htmlfont font; |
struct htmlpair tag; |
|
|
|
switch (deco) { |
switch (deco) { |
case (DECO_BOLD): |
case (DECO_PREVIOUS): |
class = "bold"; |
font = h->metal; |
break; |
break; |
case (DECO_ITALIC): |
case (DECO_ITALIC): |
class = "italic"; |
font = HTMLFONT_ITALIC; |
break; |
break; |
|
case (DECO_BOLD): |
|
font = HTMLFONT_BOLD; |
|
break; |
case (DECO_ROMAN): |
case (DECO_ROMAN): |
class = "roman"; |
font = HTMLFONT_NONE; |
break; |
break; |
default: |
default: |
abort(); |
abort(); |
/* NOTREACHED */ |
/* NOTREACHED */ |
} |
} |
|
|
if (h->metaf) { |
(void)print_ofont(h, font); |
assert(h->tags.head); |
|
assert(h->metaf == h->tags.head); |
|
print_tagq(h, h->metaf); |
|
} |
|
|
|
PAIR_CLASS_INIT(&tag, class); |
|
h->metaf = print_otag(h, TAG_SPAN, 1, &tag); |
|
} |
} |
|
|
|
|
Line 292 print_encode(struct html *h, const char *p, int norecu |
|
Line 312 print_encode(struct html *h, const char *p, int norecu |
|
case (DECO_SPECIAL): |
case (DECO_SPECIAL): |
print_spec(h, seq, sz); |
print_spec(h, seq, sz); |
break; |
break; |
|
case (DECO_PREVIOUS): |
|
/* FALLTHROUGH */ |
case (DECO_BOLD): |
case (DECO_BOLD): |
/* FALLTHROUGH */ |
/* FALLTHROUGH */ |
case (DECO_ITALIC): |
case (DECO_ITALIC): |
Line 352 print_otag(struct html *h, enum htmltag tag, |
|
Line 374 print_otag(struct html *h, enum htmltag tag, |
|
} |
} |
|
|
|
|
/* ARGSUSED */ |
|
static void |
static void |
print_ctag(struct html *h, enum htmltag tag) |
print_ctag(struct html *h, enum htmltag tag) |
{ |
{ |