summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIngo Schwarze <schwarze@cvs.openbsd.org>2010-10-23 16:08:37 +0000
committerIngo Schwarze <schwarze@cvs.openbsd.org>2010-10-23 16:08:37 +0000
commitbdc249af6535dd1a757df6cdbe97fbd299400ed4 (patch)
tree2924a9a6cb42804a53f00abf72ce92cd11501d5c
parentd7ce593667f61f889486dd1115b40c8fed241df2 (diff)
.Sm no longer produces a linebreak when used in .Bd
also avoid an extra space after the opening bracket in .Op in -Thtml from kristaps@
-rw-r--r--usr.bin/mandoc/mdoc_html.c16
-rw-r--r--usr.bin/mandoc/mdoc_term.c4
2 files changed, 17 insertions, 3 deletions
diff --git a/usr.bin/mandoc/mdoc_html.c b/usr.bin/mandoc/mdoc_html.c
index 0ea7b2b118c..53708692ee0 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.35 2010/10/16 13:38:29 schwarze Exp $ */
+/* $Id: mdoc_html.c,v 1.36 2010/10/23 16:08:36 schwarze Exp $ */
/*
* Copyright (c) 2008, 2009, 2010 Kristaps Dzonsons <kristaps@bsd.lv>
*
@@ -1321,6 +1321,8 @@ mdoc_bd_pre(MDOC_ARGS)
* anyway, so don't sweat it.
*/
switch (nn->tok) {
+ case (MDOC_Sm):
+ /* FALLTHROUGH */
case (MDOC_br):
/* FALLTHROUGH */
case (MDOC_sp):
@@ -1601,7 +1603,16 @@ mdoc_sm_pre(MDOC_ARGS)
assert(n->child && MDOC_TEXT == n->child->type);
if (0 == strcmp("on", n->child->string)) {
- /* FIXME: no p->col to check... */
+ /*
+ * FIXME: no p->col to check. Thus, if we have
+ * .Bd -literal
+ * .Sm off
+ * 1 2
+ * .Sm on
+ * 3
+ * .Ed
+ * the "3" is preceded by a space.
+ */
h->flags &= ~HTML_NOSPACE;
h->flags &= ~HTML_NONOSPACE;
} else
@@ -2154,6 +2165,7 @@ mdoc_quote_pre(MDOC_ARGS)
/* FALLTHROUGH */
case (MDOC_Op):
print_text(h, "\\(lB");
+ h->flags |= HTML_NOSPACE;
PAIR_CLASS_INIT(&tag, "opt");
print_otag(h, TAG_SPAN, 1, &tag);
break;
diff --git a/usr.bin/mandoc/mdoc_term.c b/usr.bin/mandoc/mdoc_term.c
index 86c325cd5e2..b5daf7a541e 100644
--- a/usr.bin/mandoc/mdoc_term.c
+++ b/usr.bin/mandoc/mdoc_term.c
@@ -1,4 +1,4 @@
-/* $Id: mdoc_term.c,v 1.111 2010/10/16 20:49:37 schwarze Exp $ */
+/* $Id: mdoc_term.c,v 1.112 2010/10/23 16:08:36 schwarze Exp $ */
/*
* Copyright (c) 2008, 2009, 2010 Kristaps Dzonsons <kristaps@bsd.lv>
* Copyright (c) 2010 Ingo Schwarze <schwarze@openbsd.org>
@@ -1584,6 +1584,8 @@ termp_bd_pre(DECL_ARGS)
* anyway, so don't sweat it.
*/
switch (nn->tok) {
+ case (MDOC_Sm):
+ /* FALLTHROUGH */
case (MDOC_br):
/* FALLTHROUGH */
case (MDOC_sp):