summaryrefslogtreecommitdiffstats
path: root/usr.bin/mandoc/mdoc_html.c
diff options
context:
space:
mode:
authorschwarze <schwarze@openbsd.org>2011-01-30 18:28:01 +0000
committerschwarze <schwarze@openbsd.org>2011-01-30 18:28:01 +0000
commit992063de9597c3c3c70a241d532cd6a37bc5eda3 (patch)
tree83f6001f8fcf89529a08e00a2a64e7f25da14c32 /usr.bin/mandoc/mdoc_html.c
parentLike in groff, if .%B is specified, quote .%T; from kristaps@. (diff)
downloadwireguard-openbsd-992063de9597c3c3c70a241d532cd6a37bc5eda3.tar.xz
wireguard-openbsd-992063de9597c3c3c70a241d532cd6a37bc5eda3.zip
Make .Bx accept not more than two arguments.
Convert the first character of the second argument to uppercase. Append the second argument with a hyphen. Improves chpass(1), column(1), fstat(1), ... from kristaps@
Diffstat (limited to 'usr.bin/mandoc/mdoc_html.c')
-rw-r--r--usr.bin/mandoc/mdoc_html.c22
1 files changed, 15 insertions, 7 deletions
diff --git a/usr.bin/mandoc/mdoc_html.c b/usr.bin/mandoc/mdoc_html.c
index a9447138e43..320298b928f 100644
--- a/usr.bin/mandoc/mdoc_html.c
+++ b/usr.bin/mandoc/mdoc_html.c
@@ -1,4 +1,4 @@
-/* $Id: mdoc_html.c,v 1.48 2011/01/16 19:41:16 schwarze Exp $ */
+/* $Id: mdoc_html.c,v 1.49 2011/01/30 18:28:01 schwarze Exp $ */
/*
* Copyright (c) 2008, 2009, 2010, 2011 Kristaps Dzonsons <kristaps@bsd.lv>
*
@@ -828,19 +828,27 @@ mdoc_xx_pre(MDOC_ARGS)
static int
mdoc_bx_pre(MDOC_ARGS)
{
- const struct mdoc_node *nn;
- struct htmlpair tag;
+ struct htmlpair tag;
PAIR_CLASS_INIT(&tag, "unix");
print_otag(h, TAG_SPAN, 1, &tag);
- for (nn = n->child; nn; nn = nn->next)
- print_mdoc_node(m, nn, h);
+ if (NULL != (n = n->child)) {
+ print_text(h, n->string);
+ h->flags |= HTML_NOSPACE;
+ print_text(h, "BSD");
+ } else {
+ print_text(h, "BSD");
+ return(0);
+ }
- if (n->child)
+ if (NULL != (n = n->next)) {
h->flags |= HTML_NOSPACE;
+ print_text(h, "-");
+ h->flags |= HTML_NOSPACE;
+ print_text(h, n->string);
+ }
- print_text(h, "BSD");
return(0);
}