summaryrefslogtreecommitdiffstats
path: root/roff_html.c
diff options
context:
space:
mode:
authorIngo Schwarze <schwarze@openbsd.org>2018-12-16 00:17:02 +0000
committerIngo Schwarze <schwarze@openbsd.org>2018-12-16 00:17:02 +0000
commit0cfd5175e34d41bc422a986950293edb0d8d2c38 (patch)
tree63934b15f1f9821374eb2a81ad104851dbc5cf12 /roff_html.c
parent0e3f0b740ea18224c3b2c07114be601dd8be97bb (diff)
downloadmandoc-0cfd5175e34d41bc422a986950293edb0d8d2c38.tar.gz
Yet another round of improvements to manual font selection.
Unify handling of \f and .ft. Support \f4 (bold+italic). Support ".ft BI" and ".ft CW" for terminal output. Support the .ft request in HTML output. Reject the bogus fonts \f(C1, \f(C2, \f(C3, and \f(CP. In regress.pl, only strip leading whitespace in math mode.
Diffstat (limited to 'roff_html.c')
-rw-r--r--roff_html.c16
1 files changed, 14 insertions, 2 deletions
diff --git a/roff_html.c b/roff_html.c
index ea123561..fc0f2e30 100644
--- a/roff_html.c
+++ b/roff_html.c
@@ -18,8 +18,10 @@
#include <sys/types.h>
#include <assert.h>
-#include <stddef.h>
+#include <stdio.h>
+#include <string.h>
+#include "mandoc.h"
#include "roff.h"
#include "out.h"
#include "html.h"
@@ -30,12 +32,13 @@ typedef void (*roff_html_pre_fp)(ROFF_HTML_ARGS);
static void roff_html_pre_br(ROFF_HTML_ARGS);
static void roff_html_pre_ce(ROFF_HTML_ARGS);
+static void roff_html_pre_ft(ROFF_HTML_ARGS);
static void roff_html_pre_sp(ROFF_HTML_ARGS);
static const roff_html_pre_fp roff_html_pre_acts[ROFF_MAX] = {
roff_html_pre_br, /* br */
roff_html_pre_ce, /* ce */
- NULL, /* ft */
+ roff_html_pre_ft, /* ft */
NULL, /* ll */
NULL, /* mc */
NULL, /* po */
@@ -75,6 +78,15 @@ roff_html_pre_ce(ROFF_HTML_ARGS)
}
static void
+roff_html_pre_ft(ROFF_HTML_ARGS)
+{
+ const char *cp;
+
+ cp = n->child->string;
+ print_metaf(h, mandoc_font(cp, (int)strlen(cp)));
+}
+
+static void
roff_html_pre_sp(ROFF_HTML_ARGS)
{
print_paragraph(h);