summaryrefslogtreecommitdiffstats
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
commit2bbd9e67dcfaba21933dd84288c70103acdf0474 (patch)
tree52814036f20789d121b6dd812310f08454766099 /mdoc_term.c
parent407d8b629d9eb8509d6396c80b98c0c51d6f2c9f (diff)
downloadmandoc-2bbd9e67dcfaba21933dd84288c70103acdf0474.tar.gz
implement tagging for .Er
Diffstat (limited to 'mdoc_term.c')
-rw-r--r--mdoc_term.c16
1 files changed, 15 insertions, 1 deletions
diff --git a/mdoc_term.c b/mdoc_term.c
index 0aeb281e..25d7afc5 100644
--- a/mdoc_term.c
+++ b/mdoc_term.c
@@ -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)
{