diff options
author | Ingo Schwarze <schwarze@openbsd.org> | 2018-10-25 01:32:40 +0000 |
---|---|---|
committer | Ingo Schwarze <schwarze@openbsd.org> | 2018-10-25 01:32:40 +0000 |
commit | c5692d062ca3cb8eb15948d7fbc2f5eb68be6cda (patch) | |
tree | 94de759c7f7feb9b61764095e908e723f0ae0499 /html.c | |
parent | e4c12a05e0760bea4427e66a5914d9fed0111dee (diff) | |
download | mandoc-c5692d062ca3cb8eb15948d7fbc2f5eb68be6cda.tar.gz |
Implement the \f(CW and \f(CR (constant width font) escape sequences
for HTML output. Somewhat relevant because pod2man(1) relies on this.
Missing feature reported by Pali dot Rohar at gmail dot com.
Note that constant width font was already correctly selected before
this when required by semantic markup. Only attempting physical
markup with the low-level escape sequence was ineffective.
Diffstat (limited to 'html.c')
-rw-r--r-- | html.c | 10 |
1 files changed, 10 insertions, 0 deletions
@@ -228,6 +228,9 @@ print_metaf(struct html *h, enum mandoc_esc deco) case ESCAPE_FONTBI: font = HTMLFONT_BI; break; + case ESCAPE_FONTCW: + font = HTMLFONT_CW; + break; case ESCAPE_FONT: case ESCAPE_FONTROMAN: font = HTMLFONT_NONE; @@ -255,6 +258,9 @@ print_metaf(struct html *h, enum mandoc_esc deco) 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: break; } @@ -408,6 +414,7 @@ print_encode(struct html *h, const char *p, const char *pend, int norecurse) case ESCAPE_FONTBOLD: case ESCAPE_FONTITALIC: case ESCAPE_FONTBI: + case ESCAPE_FONTCW: case ESCAPE_FONTROMAN: if (0 == norecurse) print_metaf(h, esc); @@ -738,6 +745,9 @@ print_text(struct html *h, const char *word) 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; |