aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/mdoc_term.c
diff options
context:
space:
mode:
authorIngo Schwarze <schwarze@openbsd.org>2015-07-25 14:23:08 +0000
committerIngo Schwarze <schwarze@openbsd.org>2015-07-25 14:23:08 +0000
commit7310229a6bc4ea0f603478894a168e2aa4dff9e6 (patch)
tree6ce55be23955271c1006100a3a4a136adaf5d12f /mdoc_term.c
parent8d1eb6e0f53824d1567a91f3def033e3cd01a9a2 (diff)
downloadmandoc-7310229a6bc4ea0f603478894a168e2aa4dff9e6.tar.gz
mandoc-7310229a6bc4ea0f603478894a168e2aa4dff9e6.tar.zst
mandoc-7310229a6bc4ea0f603478894a168e2aa4dff9e6.zip
implement tagging for .Er
Diffstat (limited to 'mdoc_term.c')
-rw-r--r--mdoc_term.c18
1 files changed, 16 insertions, 2 deletions
diff --git a/mdoc_term.c b/mdoc_term.c
index 7486fa44..3eea9d13 100644
--- a/mdoc_term.c
+++ b/mdoc_term.c
@@ -1,4 +1,4 @@
-/* $Id: mdoc_term.c,v 1.322 2015/07/25 14:18:04 schwarze Exp $ */
+/* $Id: mdoc_term.c,v 1.323 2015/07/25 14:23:08 schwarze Exp $ */
/*
* Copyright (c) 2008, 2009, 2010, 2011 Kristaps Dzonsons <kristaps@bsd.lv>
* Copyright (c) 2010, 2012-2015 Ingo Schwarze <schwarze@openbsd.org>
@@ -95,6 +95,7 @@ static int termp_bx_pre(DECL_ARGS);
static int termp_cd_pre(DECL_ARGS);
static int termp_d1_pre(DECL_ARGS);
static int termp_eo_pre(DECL_ARGS);
+static int termp_er_pre(DECL_ARGS);
static int termp_ex_pre(DECL_ARGS);
static int termp_fa_pre(DECL_ARGS);
static int termp_fd_pre(DECL_ARGS);
@@ -146,7 +147,7 @@ static const struct termact termacts[MDOC_MAX] = {
{ termp_cd_pre, NULL }, /* Cd */
{ termp_bold_pre, NULL }, /* Cm */
{ NULL, NULL }, /* Dv */
- { NULL, NULL }, /* Er */
+ { termp_er_pre, NULL }, /* Er */
{ termp_tag_pre, NULL }, /* Ev */
{ termp_ex_pre, NULL }, /* Ex */
{ termp_fa_pre, NULL }, /* Fa */
@@ -2273,6 +2274,19 @@ termp_under_pre(DECL_ARGS)
}
static int
+termp_er_pre(DECL_ARGS)
+{
+
+ if (n->sec == SEC_ERRORS &&
+ (n->parent->tok == MDOC_It ||
+ (n->parent->tok == MDOC_Bq &&
+ n->parent->parent->parent->tok == MDOC_It)) &&
+ ! tag_get(n->child->string, 0, 1))
+ tag_put(n->child->string, 0, 1, p->line);
+ return(1);
+}
+
+static int
termp_tag_pre(DECL_ARGS)
{