summaryrefslogtreecommitdiffstats
path: root/mdoc_term.c
diff options
context:
space:
mode:
authorIngo Schwarze <schwarze@openbsd.org>2016-11-08 16:23:58 +0000
committerIngo Schwarze <schwarze@openbsd.org>2016-11-08 16:23:58 +0000
commit42da7981d484f510a73f6b976f22bdb749ab04bb (patch)
tree3d0021638ff9d0ab6c9155ff3d603cf71a42f39c /mdoc_term.c
parentbef62492fa9d4ef61624e3616a1d3b13e8fe697e (diff)
downloadmandoc-42da7981d484f510a73f6b976f22bdb749ab04bb.tar.gz
implement tag priority 0, which will tag only keys that appear as
tag candidates exactly once, and use it for .Em and .Sy; written on the TGV Toulouse-Paris
Diffstat (limited to 'mdoc_term.c')
-rw-r--r--mdoc_term.c26
1 files changed, 24 insertions, 2 deletions
diff --git a/mdoc_term.c b/mdoc_term.c
index bdfa5099..d41ea13e 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_em_pre(DECL_ARGS);
static int termp_er_pre(DECL_ARGS);
static int termp_ex_pre(DECL_ARGS);
static int termp_fa_pre(DECL_ARGS);
@@ -119,6 +120,7 @@ static int termp_skip_pre(DECL_ARGS);
static int termp_sm_pre(DECL_ARGS);
static int termp_sp_pre(DECL_ARGS);
static int termp_ss_pre(DECL_ARGS);
+static int termp_sy_pre(DECL_ARGS);
static int termp_tag_pre(DECL_ARGS);
static int termp_under_pre(DECL_ARGS);
static int termp_ud_pre(DECL_ARGS);
@@ -195,7 +197,7 @@ static const struct termact termacts[MDOC_MAX] = {
{ termp_quote_pre, termp_quote_post }, /* Dq */
{ NULL, NULL }, /* Ec */ /* FIXME: no space */
{ NULL, NULL }, /* Ef */
- { termp_under_pre, NULL }, /* Em */
+ { termp_em_pre, NULL }, /* Em */
{ termp_eo_pre, termp_eo_post }, /* Eo */
{ termp_xx_pre, NULL }, /* Fx */
{ termp_bold_pre, NULL }, /* Ms */
@@ -218,7 +220,7 @@ static const struct termact termacts[MDOC_MAX] = {
{ termp_quote_pre, termp_quote_post }, /* Sq */
{ termp_sm_pre, NULL }, /* Sm */
{ termp_under_pre, NULL }, /* Sx */
- { termp_bold_pre, NULL }, /* Sy */
+ { termp_sy_pre, NULL }, /* Sy */
{ NULL, NULL }, /* Tn */
{ termp_xx_pre, NULL }, /* Ux */
{ NULL, NULL }, /* Xc */
@@ -2218,6 +2220,26 @@ termp_under_pre(DECL_ARGS)
}
static int
+termp_em_pre(DECL_ARGS)
+{
+ if (n->child != NULL &&
+ n->child->type == ROFFT_TEXT)
+ tag_put(n->child->string, 0, p->line);
+ term_fontpush(p, TERMFONT_UNDER);
+ return 1;
+}
+
+static int
+termp_sy_pre(DECL_ARGS)
+{
+ if (n->child != NULL &&
+ n->child->type == ROFFT_TEXT)
+ tag_put(n->child->string, 0, p->line);
+ term_fontpush(p, TERMFONT_BOLD);
+ return 1;
+}
+
+static int
termp_er_pre(DECL_ARGS)
{