summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--regress/usr.bin/mandoc/mdoc/Aq/Makefile5
-rw-r--r--regress/usr.bin/mandoc/mdoc/Aq/author.in10
-rw-r--r--regress/usr.bin/mandoc/mdoc/Aq/author.out_ascii13
-rw-r--r--regress/usr.bin/mandoc/mdoc/Aq/author.out_utf813
-rw-r--r--regress/usr.bin/mandoc/mdoc/Aq/empty.out_utf89
-rw-r--r--usr.bin/mandoc/mdoc_html.c8
-rw-r--r--usr.bin/mandoc/mdoc_man.c27
-rw-r--r--usr.bin/mandoc/mdoc_term.c8
8 files changed, 82 insertions, 11 deletions
diff --git a/regress/usr.bin/mandoc/mdoc/Aq/Makefile b/regress/usr.bin/mandoc/mdoc/Aq/Makefile
index bbc1d584975..ae347ad37d9 100644
--- a/regress/usr.bin/mandoc/mdoc/Aq/Makefile
+++ b/regress/usr.bin/mandoc/mdoc/Aq/Makefile
@@ -1,5 +1,6 @@
-# $OpenBSD: Makefile,v 1.1 2011/12/04 03:09:25 schwarze Exp $
+# $OpenBSD: Makefile,v 1.2 2014/11/19 21:59:20 schwarze Exp $
-REGRESS_TARGETS=empty
+REGRESS_TARGETS = author empty
+UTF8_TARGETS = author empty
.include <bsd.regress.mk>
diff --git a/regress/usr.bin/mandoc/mdoc/Aq/author.in b/regress/usr.bin/mandoc/mdoc/Aq/author.in
new file mode 100644
index 00000000000..9e007f5899b
--- /dev/null
+++ b/regress/usr.bin/mandoc/mdoc/Aq/author.in
@@ -0,0 +1,10 @@
+.Dd November 19, 2014
+.Dt AQ-AUTHOR 1
+.Os OpenBSD
+.Sh NAME
+.Nm Aq-author
+.Nd angle brackets after an author name macro
+.Sh DESCRIPTION
+.An Name Ao Mt addr Ac An Name Aq Mt addr
+.Sh AUTHORS
+.An Name Ao Mt addr Ac An Name Aq Mt addr
diff --git a/regress/usr.bin/mandoc/mdoc/Aq/author.out_ascii b/regress/usr.bin/mandoc/mdoc/Aq/author.out_ascii
new file mode 100644
index 00000000000..80775148bf4
--- /dev/null
+++ b/regress/usr.bin/mandoc/mdoc/Aq/author.out_ascii
@@ -0,0 +1,13 @@
+AQ-AUTHOR(1) General Commands Manual AQ-AUTHOR(1)
+
+NNAAMMEE
+ AAqq--aauutthhoorr - angle brackets after an author name macro
+
+DDEESSCCRRIIPPTTIIOONN
+ Name <_a_d_d_r> Name <_a_d_d_r>
+
+AAUUTTHHOORRSS
+ Name <_a_d_d_r>
+ Name <_a_d_d_r>
+
+OpenBSD November 19, 2014 OpenBSD
diff --git a/regress/usr.bin/mandoc/mdoc/Aq/author.out_utf8 b/regress/usr.bin/mandoc/mdoc/Aq/author.out_utf8
new file mode 100644
index 00000000000..28c4faca702
--- /dev/null
+++ b/regress/usr.bin/mandoc/mdoc/Aq/author.out_utf8
@@ -0,0 +1,13 @@
+AQ-AUTHOR(1) General Commands Manual AQ-AUTHOR(1)
+
+NNAAMMEE
+ AAqq--aauutthhoorr – angle brackets after an author name macro
+
+DDEESSCCRRIIPPTTIIOONN
+ Name <_a_d_d_r> Name <_a_d_d_r>
+
+AAUUTTHHOORRSS
+ Name <_a_d_d_r>
+ Name <_a_d_d_r>
+
+OpenBSD November 19, 2014 OpenBSD
diff --git a/regress/usr.bin/mandoc/mdoc/Aq/empty.out_utf8 b/regress/usr.bin/mandoc/mdoc/Aq/empty.out_utf8
new file mode 100644
index 00000000000..0ae72b6f239
--- /dev/null
+++ b/regress/usr.bin/mandoc/mdoc/Aq/empty.out_utf8
@@ -0,0 +1,9 @@
+AQ-EMPTY(1) General Commands Manual AQ-EMPTY(1)
+
+NNAAMMEE
+ AAqq--eemmppttyy – empty implicit enclosure macros
+
+DDEESSCCRRIIPPTTIIOONN
+ An empty ⟨⟩ and a full ⟨user@host⟩ return path. And another ⟨full⟩ one.
+
+OpenBSD August 6, 2010 OpenBSD
diff --git a/usr.bin/mandoc/mdoc_html.c b/usr.bin/mandoc/mdoc_html.c
index 2d22fa747cd..7146784f71a 100644
--- a/usr.bin/mandoc/mdoc_html.c
+++ b/usr.bin/mandoc/mdoc_html.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: mdoc_html.c,v 1.85 2014/11/17 06:44:35 schwarze Exp $ */
+/* $OpenBSD: mdoc_html.c,v 1.86 2014/11/19 21:59:19 schwarze Exp $ */
/*
* Copyright (c) 2008-2011, 2014 Kristaps Dzonsons <kristaps@bsd.lv>
* Copyright (c) 2014 Ingo Schwarze <schwarze@openbsd.org>
@@ -2073,7 +2073,8 @@ mdoc_quote_pre(MDOC_ARGS)
case MDOC_Ao:
/* FALLTHROUGH */
case MDOC_Aq:
- print_text(h, "\\(la");
+ print_text(h, n->parent->prev != NULL &&
+ n->parent->prev->tok == MDOC_An ? "<" : "\\(la");
break;
case MDOC_Bro:
/* FALLTHROUGH */
@@ -2149,7 +2150,8 @@ mdoc_quote_post(MDOC_ARGS)
case MDOC_Ao:
/* FALLTHROUGH */
case MDOC_Aq:
- print_text(h, "\\(ra");
+ print_text(h, n->parent->prev != NULL &&
+ n->parent->prev->tok == MDOC_An ? ">" : "\\(ra");
break;
case MDOC_Bro:
/* FALLTHROUGH */
diff --git a/usr.bin/mandoc/mdoc_man.c b/usr.bin/mandoc/mdoc_man.c
index 3e5e5e2eca2..226fb720b3d 100644
--- a/usr.bin/mandoc/mdoc_man.c
+++ b/usr.bin/mandoc/mdoc_man.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: mdoc_man.c,v 1.71 2014/11/17 06:44:35 schwarze Exp $ */
+/* $OpenBSD: mdoc_man.c,v 1.72 2014/11/19 21:59:19 schwarze Exp $ */
/*
* Copyright (c) 2011, 2012, 2013, 2014 Ingo Schwarze <schwarze@openbsd.org>
*
@@ -44,6 +44,7 @@ static void font_push(char);
static void font_pop(void);
static void mid_it(void);
static void post__t(DECL_ARGS);
+static void post_aq(DECL_ARGS);
static void post_bd(DECL_ARGS);
static void post_bf(DECL_ARGS);
static void post_bk(DECL_ARGS);
@@ -70,6 +71,7 @@ static void post_vt(DECL_ARGS);
static int pre__t(DECL_ARGS);
static int pre_an(DECL_ARGS);
static int pre_ap(DECL_ARGS);
+static int pre_aq(DECL_ARGS);
static int pre_bd(DECL_ARGS);
static int pre_bf(DECL_ARGS);
static int pre_bk(DECL_ARGS);
@@ -170,8 +172,8 @@ static const struct manact manacts[MDOC_MAX + 1] = {
{ NULL, pre__t, post__t, NULL, NULL }, /* %T */
{ NULL, NULL, post_percent, NULL, NULL }, /* %V */
{ NULL, NULL, NULL, NULL, NULL }, /* Ac */
- { cond_body, pre_enc, post_enc, "<", ">" }, /* Ao */
- { cond_body, pre_enc, post_enc, "<", ">" }, /* Aq */
+ { cond_body, pre_aq, post_aq, NULL, NULL }, /* Ao */
+ { cond_body, pre_aq, post_aq, NULL, NULL }, /* Aq */
{ NULL, NULL, NULL, NULL, NULL }, /* At */
{ NULL, NULL, NULL, NULL, NULL }, /* Bc */
{ NULL, pre_bf, post_bf, NULL, NULL }, /* Bf */
@@ -868,6 +870,25 @@ pre_ap(DECL_ARGS)
}
static int
+pre_aq(DECL_ARGS)
+{
+
+ print_word(n->parent->prev != NULL &&
+ n->parent->prev->tok == MDOC_An ? "<" : "\\(la");
+ outflags &= ~MMAN_spc;
+ return(1);
+}
+
+static void
+post_aq(DECL_ARGS)
+{
+
+ outflags &= ~(MMAN_spc | MMAN_nl);
+ print_word(n->parent->prev != NULL &&
+ n->parent->prev->tok == MDOC_An ? ">" : "\\(ra");
+}
+
+static int
pre_bd(DECL_ARGS)
{
diff --git a/usr.bin/mandoc/mdoc_term.c b/usr.bin/mandoc/mdoc_term.c
index 83c89aed33b..e74a951f336 100644
--- a/usr.bin/mandoc/mdoc_term.c
+++ b/usr.bin/mandoc/mdoc_term.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: mdoc_term.c,v 1.189 2014/11/17 06:44:35 schwarze Exp $ */
+/* $OpenBSD: mdoc_term.c,v 1.190 2014/11/19 21:59:19 schwarze Exp $ */
/*
* Copyright (c) 2008, 2009, 2010, 2011 Kristaps Dzonsons <kristaps@bsd.lv>
* Copyright (c) 2010, 2012, 2013, 2014 Ingo Schwarze <schwarze@openbsd.org>
@@ -1852,7 +1852,8 @@ termp_quote_pre(DECL_ARGS)
case MDOC_Ao:
/* FALLTHROUGH */
case MDOC_Aq:
- term_word(p, "<");
+ term_word(p, n->parent->prev != NULL &&
+ n->parent->prev->tok == MDOC_An ? "<" : "\\(la");
break;
case MDOC_Bro:
/* FALLTHROUGH */
@@ -1923,7 +1924,8 @@ termp_quote_post(DECL_ARGS)
case MDOC_Ao:
/* FALLTHROUGH */
case MDOC_Aq:
- term_word(p, ">");
+ term_word(p, n->parent->prev != NULL &&
+ n->parent->prev->tok == MDOC_An ? ">" : "\\(ra");
break;
case MDOC_Bro:
/* FALLTHROUGH */