summaryrefslogtreecommitdiffstats
path: root/mdoc_man.c
diff options
context:
space:
mode:
authorIngo Schwarze <schwarze@openbsd.org>2014-11-19 22:00:37 +0000
committerIngo Schwarze <schwarze@openbsd.org>2014-11-19 22:00:37 +0000
commita32978d2cad8df466fc1ad27d42e6aff9ce25c9b (patch)
treec714612c5e85e550a2442a25bf4b1039e2c6cb8b /mdoc_man.c
parente83d3f1920808345008b02a30870871c3f4e489d (diff)
downloadmandoc-a32978d2cad8df466fc1ad27d42e6aff9ce25c9b.tar.gz
Let .Ao and .Aq render as "<>" after .An and as "\(la\(ra" elsewhere,
just like groff; minibug noticed by bentley@.
Diffstat (limited to 'mdoc_man.c')
-rw-r--r--mdoc_man.c25
1 files changed, 23 insertions, 2 deletions
diff --git a/mdoc_man.c b/mdoc_man.c
index e5d062c9..483c986f 100644
--- a/mdoc_man.c
+++ b/mdoc_man.c
@@ -46,6 +46,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);
@@ -72,6 +73,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);
@@ -172,8 +174,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 */
@@ -870,6 +872,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)
{