aboutsummaryrefslogtreecommitdiffstatshomepage
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
commitfb7ea55796176565141285c5c6de1d3127655116 (patch)
tree63b21db96671f3ca27e3f0658ae34a5d8babc63d /roff_html.c
parentd672f8cb82878baf3834e938c4c416f4493952cf (diff)
downloadmandoc-fb7ea55796176565141285c5c6de1d3127655116.tar.gz
mandoc-fb7ea55796176565141285c5c6de1d3127655116.tar.zst
mandoc-fb7ea55796176565141285c5c6de1d3127655116.zip
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.c18
1 files changed, 15 insertions, 3 deletions
diff --git a/roff_html.c b/roff_html.c
index aec483e4..adcbbf5b 100644
--- a/roff_html.c
+++ b/roff_html.c
@@ -1,4 +1,4 @@
-/* $Id: roff_html.c,v 1.14 2018/12/13 11:55:47 schwarze Exp $ */
+/* $Id: roff_html.c,v 1.15 2018/12/16 00:17:02 schwarze Exp $ */
/*
* Copyright (c) 2010 Kristaps Dzonsons <kristaps@bsd.lv>
* Copyright (c) 2014, 2017, 2018 Ingo Schwarze <schwarze@openbsd.org>
@@ -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);