aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/mdoc_validate.c
diff options
context:
space:
mode:
authorKristaps Dzonsons <kristaps@bsd.lv>2010-12-25 13:50:37 +0000
committerKristaps Dzonsons <kristaps@bsd.lv>2010-12-25 13:50:37 +0000
commit97ea338f64152142a27642d6ee10c3a0ae63be1e (patch)
tree1b2d5de6e555a424a34af16bcbfcd0dd5015c9ba /mdoc_validate.c
parent7e94ba8189f4be23fa521d65778589feb5655811 (diff)
downloadmandoc-97ea338f64152142a27642d6ee10c3a0ae63be1e.tar.gz
mandoc-97ea338f64152142a27642d6ee10c3a0ae63be1e.tar.zst
mandoc-97ea338f64152142a27642d6ee10c3a0ae63be1e.zip
Specifying both %T and %J in an `Rs' block causes the title to be quoted
instead of underlined. This only happens in -Tascii, as -T[x]html both underlines and italicises.
Diffstat (limited to 'mdoc_validate.c')
-rw-r--r--mdoc_validate.c19
1 files changed, 17 insertions, 2 deletions
diff --git a/mdoc_validate.c b/mdoc_validate.c
index 5a102460..b359df7e 100644
--- a/mdoc_validate.c
+++ b/mdoc_validate.c
@@ -1,4 +1,4 @@
-/* $Id: mdoc_validate.c,v 1.147 2010/12/24 14:00:40 kristaps Exp $ */
+/* $Id: mdoc_validate.c,v 1.148 2010/12/25 13:50:37 kristaps Exp $ */
/*
* Copyright (c) 2008, 2009, 2010 Kristaps Dzonsons <kristaps@bsd.lv>
*
@@ -1649,8 +1649,19 @@ post_rs(POST_ARGS)
{
struct mdoc_node *nn, *next, *prev;
int i, j;
+ int *tj;
+#define RS_JOURNAL (1 << 0)
+#define RS_TITLE (1 << 1)
- if (MDOC_BODY != mdoc->last->type)
+ /* Mark whether we're carrying both a %T and %J. */
+
+ tj = &mdoc->last->norm->Rs.titlejournal;
+
+ if (MDOC_BLOCK == mdoc->last->type) {
+ if ( ! (RS_JOURNAL & *tj && RS_TITLE & *tj))
+ *tj = 0;
+ return(1);
+ } else if (MDOC_BODY != mdoc->last->type)
return(1);
/*
@@ -1666,6 +1677,10 @@ post_rs(POST_ARGS)
break;
if (i < RSORD_MAX) {
+ if (MDOC__T == rsord[i])
+ *tj |= RS_TITLE;
+ else if (MDOC__J == rsord[i])
+ *tj |= RS_JOURNAL;
next = nn->next;
continue;
}