aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/mdoc_term.c
diff options
context:
space:
mode:
authorKristaps Dzonsons <kristaps@bsd.lv>2010-06-04 21:49:39 +0000
committerKristaps Dzonsons <kristaps@bsd.lv>2010-06-04 21:49:39 +0000
commit67a51824265c8e0d0f41e8cacb1714e5671c7053 (patch)
treea42511e4878a1a70863b6e7ac3faa1e566a072a7 /mdoc_term.c
parent12bd5ba1acfc34cc1274b3b3d2c1a9e28978bb6e (diff)
downloadmandoc-67a51824265c8e0d0f41e8cacb1714e5671c7053.tar.gz
mandoc-67a51824265c8e0d0f41e8cacb1714e5671c7053.tar.zst
mandoc-67a51824265c8e0d0f41e8cacb1714e5671c7053.zip
Documented `In' in full.
Fixed `In' to behave properly: it wasn't properly breaking lines, formatting, or really anything else. Noted COMPATIBILITY with OpenBSD's groff, which pukes all over `In'.
Diffstat (limited to 'mdoc_term.c')
-rw-r--r--mdoc_term.c33
1 files changed, 15 insertions, 18 deletions
diff --git a/mdoc_term.c b/mdoc_term.c
index 98ce0bbe..2c161d65 100644
--- a/mdoc_term.c
+++ b/mdoc_term.c
@@ -1,4 +1,4 @@
-/* $Id: mdoc_term.c,v 1.137 2010/06/04 21:05:39 kristaps Exp $ */
+/* $Id: mdoc_term.c,v 1.138 2010/06/04 21:49:39 kristaps Exp $ */
/*
* Copyright (c) 2008, 2009 Kristaps Dzonsons <kristaps@kth.se>
*
@@ -1847,11 +1847,15 @@ static int
termp_in_pre(DECL_ARGS)
{
- term_fontpush(p, TERMFONT_BOLD);
- if (SEC_SYNOPSIS == n->sec)
+ if (SEC_SYNOPSIS == n->sec && MDOC_LINE & n->flags) {
+ term_fontpush(p, TERMFONT_BOLD);
term_word(p, "#include");
+ term_word(p, "<");
+ } else {
+ term_word(p, "<");
+ term_fontpush(p, TERMFONT_UNDER);
+ }
- term_word(p, "<");
p->flags |= TERMP_NOSPACE;
return(1);
}
@@ -1862,23 +1866,16 @@ static void
termp_in_post(DECL_ARGS)
{
- term_fontpush(p, TERMFONT_BOLD);
+ if (SEC_SYNOPSIS == n->sec && MDOC_LINE & n->flags)
+ term_fontpush(p, TERMFONT_BOLD);
+
p->flags |= TERMP_NOSPACE;
term_word(p, ">");
- term_fontpop(p);
-
- if (SEC_SYNOPSIS != n->sec || ! (MDOC_LINE & n->flags))
- return;
- term_newln(p);
- /*
- * XXX Not entirely correct. If `.In foo bar' is specified in
- * the SYNOPSIS section, then it produces a single break after
- * the <foo>; mandoc asserts a vertical space. Since this
- * construction is rarely used, I think it's fine.
- */
- if (n->next && MDOC_In != n->next->tok)
- term_vspace(p);
+ if (SEC_SYNOPSIS == n->sec && MDOC_LINE & n->flags) {
+ term_fontpop(p);
+ term_newln(p);
+ }
}