summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKristaps Dzonsons <kristaps@bsd.lv>2011-01-25 10:37:49 +0000
committerKristaps Dzonsons <kristaps@bsd.lv>2011-01-25 10:37:49 +0000
commit3349c72d72c8acc21ae7930af2eb590dbe4617a0 (patch)
treeeaafa03a110d0f89290807f36acce68a9d4d944c
parentef0c12c03523dc1118e1aedf95ea477327b2c1cd (diff)
downloadmandoc-3349c72d72c8acc21ae7930af2eb590dbe4617a0.tar.gz
If %B is specified, quote %T. Noted by schwarze@ in the TODO.
-rw-r--r--TODO5
-rw-r--r--mdoc.h2
-rw-r--r--mdoc_term.c4
-rw-r--r--mdoc_validate.c4
4 files changed, 5 insertions, 10 deletions
diff --git a/TODO b/TODO
index b83f0d93..769e2176 100644
--- a/TODO
+++ b/TODO
@@ -265,11 +265,6 @@
.Xc
The input text is appended after the specified line.
-- When we have both .%T and .%B in .Rs, .%T uses "", not underline, see
- for example arp(4); admittedly, arp(4) is abusing both .%T and .%B,
- but when dealing with anthologies, sensible use of of both in the
- same .Rs can occur.
-
- Header lines of excessive length:
Port OpenBSD man_term.c rev. 1.25 to mdoc_term.c
and document it in mdoc(7) and man(7) COMPATIBILITY
diff --git a/mdoc.h b/mdoc.h
index c54fe605..c81b8454 100644
--- a/mdoc.h
+++ b/mdoc.h
@@ -355,7 +355,7 @@ struct mdoc_an {
};
struct mdoc_rs {
- struct mdoc_node *child_J; /* pointer to %J */
+ int quote_T; /* whether to quote %T */
};
/*
diff --git a/mdoc_term.c b/mdoc_term.c
index 1d01baca..ee369f09 100644
--- a/mdoc_term.c
+++ b/mdoc_term.c
@@ -2169,7 +2169,7 @@ termp__t_post(DECL_ARGS)
* us instead of underlining us (for disambiguation).
*/
if (n->parent && MDOC_Rs == n->parent->tok &&
- n->parent->norm->Rs.child_J)
+ n->parent->norm->Rs.quote_T)
termp_quote_post(p, pair, m, n);
termp____post(p, pair, m, n);
@@ -2185,7 +2185,7 @@ termp__t_pre(DECL_ARGS)
* us instead of underlining us (for disambiguation).
*/
if (n->parent && MDOC_Rs == n->parent->tok &&
- n->parent->norm->Rs.child_J)
+ n->parent->norm->Rs.quote_T)
return(termp_quote_pre(p, pair, m, n));
term_fontpush(p, TERMFONT_UNDER);
diff --git a/mdoc_validate.c b/mdoc_validate.c
index 0e8f6d53..94dea3d9 100644
--- a/mdoc_validate.c
+++ b/mdoc_validate.c
@@ -1665,8 +1665,8 @@ post_rs(POST_ARGS)
break;
if (i < RSORD_MAX) {
- if (MDOC__J == rsord[i])
- mdoc->last->norm->Rs.child_J = nn;
+ if (MDOC__J == rsord[i] || MDOC__B == rsord[i])
+ mdoc->last->norm->Rs.quote_T++;
next = nn->next;
continue;
}