summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--html.c2
-rw-r--r--man.73
-rw-r--r--man_html.c10
-rw-r--r--mandoc.116
-rw-r--r--mdoc_html.c4
5 files changed, 25 insertions, 10 deletions
diff --git a/html.c b/html.c
index 66421a8e..be87919e 100644
--- a/html.c
+++ b/html.c
@@ -237,7 +237,7 @@ print_ofont(struct html *h, enum htmlfont font)
/* FIXME: DECO_ROMAN should just close out preexisting. */
- if (h->metaf)
+ if (h->metaf && h->tags.head == h->metaf)
print_tagq(h, h->metaf);
PAIR_CLASS_INIT(&tag, htmlfonts[font]);
diff --git a/man.7 b/man.7
index 6ceb6988..f1aa766e 100644
--- a/man.7
+++ b/man.7
@@ -110,6 +110,9 @@ A numerical representation 3, 2, or 1 (bold, italic, and Roman,
respectively) may be used instead. A text decoration is only valid, if
specified in free-form text, until the next macro invocation; if
specified within a macro, it's only valid until the macro closes scope.
+Note that macros like
+.Sx \&BR
+open and close a font scope with each argument.
.Pp
Text may also be sized with the
.Sq \es
diff --git a/man_html.c b/man_html.c
index 3c53726a..d510ac09 100644
--- a/man_html.c
+++ b/man_html.c
@@ -209,6 +209,7 @@ print_man_node(MAN_ARGS)
if (child && n->child)
print_man_nodelist(m, n->child, h);
+ /* This will automatically close out any font scope. */
print_stagq(h, t);
bufinit(h);
@@ -252,8 +253,7 @@ man_root_pre(MAN_ARGS)
if (m->vol)
(void)strlcat(b, m->vol, BUFSIZ);
- (void)snprintf(title, BUFSIZ - 1,
- "%s(%d)", m->title, m->msec);
+ snprintf(title, BUFSIZ - 1, "%s(%d)", m->title, m->msec);
PAIR_CLASS_INIT(&tag[0], "header");
bufcat_style(h, "width", "100%");
@@ -344,6 +344,7 @@ man_br_pre(MAN_ARGS)
bufcat_su(h, "height", &su);
PAIR_STYLE_INIT(&tag, h);
print_otag(h, TAG_DIV, 1, &tag);
+
/* So the div isn't empty: */
print_text(h, "\\~");
@@ -425,6 +426,11 @@ man_alt_pre(MAN_ARGS)
if (i)
h->flags |= HTML_NOSPACE;
+ /*
+ * Open and close the scope with each argument, so that
+ * internal \f escapes, which are common, are also
+ * closed out with the scope.
+ */
t = print_ofont(h, fp);
print_man_node(m, nn, h);
print_tagq(h, t);
diff --git a/mandoc.1 b/mandoc.1
index 1e6dd4b3..48822830 100644
--- a/mandoc.1
+++ b/mandoc.1
@@ -384,6 +384,16 @@ Sentences are unilaterally monospaced.
.Bl -bullet -compact
.It
The
+.Sq \efP
+escape will revert the font to the previous
+.Sq \ef
+escape, not to the last rendered decoration, which is now dictated by
+CSS instead of hard-coded. It also will not span past the current
+scope, for the same reason. Note that in
+.Sx ASCII Output
+mode, this will work fine.
+.It
+The
.Xr mdoc 7
.Sq \&Bl \-hang
and
@@ -422,11 +432,9 @@ formats with
.Pp
The
.Fl T Ns Ar html
-utility doesn't support the
-.Sq \ef
-and
+utility doesn't yet render the
.Sq \es
-text decorations documented in
+font size escape documented in
.Xr mdoc 7
and
.Xr man 7 .
diff --git a/mdoc_html.c b/mdoc_html.c
index dc8d468c..c415909c 100644
--- a/mdoc_html.c
+++ b/mdoc_html.c
@@ -424,7 +424,7 @@ print_mdoc_node(MDOC_ARGS)
break;
case (MDOC_TEXT):
print_text(h, n->string);
- break;
+ return;
default:
if (mdocs[n->tok].pre)
child = (*mdocs[n->tok].pre)(m, n, h);
@@ -441,8 +441,6 @@ print_mdoc_node(MDOC_ARGS)
case (MDOC_ROOT):
mdoc_root_post(m, n, h);
break;
- case (MDOC_TEXT):
- break;
default:
if (mdocs[n->tok].post)
(*mdocs[n->tok].post)(m, n, h);