summaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorKristaps Dzonsons <kristaps@bsd.lv>2009-11-16 08:46:58 +0000
committerKristaps Dzonsons <kristaps@bsd.lv>2009-11-16 08:46:58 +0000
commit74b8d5112618021ff48a1c5671a4e86a3d6bc1ce (patch)
treea6aebe43361d7eb3751f8a2dcd1197fa1a7a9510
parent22c7cae08d6738c1f72bb810050cc88010d6d7b3 (diff)
downloadmandoc-74b8d5112618021ff48a1c5671a4e86a3d6bc1ce.tar.gz
mandoc-74b8d5112618021ff48a1c5671a4e86a3d6bc1ce.tar.zst
mandoc-74b8d5112618021ff48a1c5671a4e86a3d6bc1ce.zip
Enabled -Thtml -mdoc to work with \f (see compat notes in mandoc.1).
-rw-r--r--html.c4
-rw-r--r--man.77
-rw-r--r--man_html.c12
-rw-r--r--mandoc.120
-rw-r--r--mdoc_html.c6
5 files changed, 32 insertions, 17 deletions
diff --git a/html.c b/html.c
index e8b44730..0c681fc5 100644
--- a/html.c
+++ b/html.c
@@ -1,4 +1,4 @@
-/* $Id: html.c,v 1.90 2009/11/16 06:07:49 kristaps Exp $ */
+/* $Id: html.c,v 1.91 2009/11/16 08:46:58 kristaps Exp $ */
/*
* Copyright (c) 2008, 2009 Kristaps Dzonsons <kristaps@kth.se>
*
@@ -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 b2c8558b..efaf893e 100644
--- a/man.7
+++ b/man.7
@@ -1,4 +1,4 @@
-.\" $Id: man.7,v 1.53 2009/11/15 06:45:31 kristaps Exp $
+.\" $Id: man.7,v 1.54 2009/11/16 08:46:59 kristaps Exp $
.\"
.\" Copyright (c) 2009 Kristaps Dzonsons <kristaps@kth.se>
.\"
@@ -14,7 +14,7 @@
.\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
.\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
.\"
-.Dd $Mdocdate: November 15 2009 $
+.Dd $Mdocdate: November 16 2009 $
.Dt MAN 7
.Os
.
@@ -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 5f6c4cf2..f2338ab7 100644
--- a/man_html.c
+++ b/man_html.c
@@ -1,4 +1,4 @@
-/* $Id: man_html.c,v 1.23 2009/11/16 06:07:49 kristaps Exp $ */
+/* $Id: man_html.c,v 1.24 2009/11/16 08:46:59 kristaps Exp $ */
/*
* Copyright (c) 2008, 2009 Kristaps Dzonsons <kristaps@kth.se>
*
@@ -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 df935e35..0f6816fa 100644
--- a/mandoc.1
+++ b/mandoc.1
@@ -1,4 +1,4 @@
-.\" $Id: mandoc.1,v 1.46 2009/11/05 10:16:01 kristaps Exp $
+.\" $Id: mandoc.1,v 1.47 2009/11/16 08:46:59 kristaps Exp $
.\"
.\" Copyright (c) 2009 Kristaps Dzonsons <kristaps@kth.se>
.\"
@@ -14,7 +14,7 @@
.\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
.\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
.\"
-.Dd $Mdocdate: November 5 2009 $
+.Dd $Mdocdate: November 16 2009 $
.Dt MANDOC 1
.Os
.
@@ -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 df14ea61..fa8fcbf3 100644
--- a/mdoc_html.c
+++ b/mdoc_html.c
@@ -1,4 +1,4 @@
-/* $Id: mdoc_html.c,v 1.47 2009/11/14 12:04:59 kristaps Exp $ */
+/* $Id: mdoc_html.c,v 1.48 2009/11/16 08:46:59 kristaps Exp $ */
/*
* Copyright (c) 2008, 2009 Kristaps Dzonsons <kristaps@kth.se>
*
@@ -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);