summaryrefslogtreecommitdiffstats
path: root/mdoc_term.c
diff options
context:
space:
mode:
authorIngo Schwarze <schwarze@openbsd.org>2010-06-27 01:26:20 +0000
committerIngo Schwarze <schwarze@openbsd.org>2010-06-27 01:26:20 +0000
commit186075c603215a3baa6ee2dd6ff0060ae58deb63 (patch)
tree6a031f6e6b2fe6e9aef2093cce03b01c787d5d89 /mdoc_term.c
parentc5cf90497acc3621015972b85b9c079b43601342 (diff)
downloadmandoc-186075c603215a3baa6ee2dd6ff0060ae58deb63.tar.gz
Basic implementation of .Bk/.Ek; from OpenBSD.
OK and one stylistic tweak by kristaps@.
Diffstat (limited to 'mdoc_term.c')
-rw-r--r--mdoc_term.c22
1 files changed, 21 insertions, 1 deletions
diff --git a/mdoc_term.c b/mdoc_term.c
index 8943e8d2..7cc7388c 100644
--- a/mdoc_term.c
+++ b/mdoc_term.c
@@ -73,6 +73,7 @@ static void termp____post(DECL_ARGS);
static void termp_an_post(DECL_ARGS);
static void termp_aq_post(DECL_ARGS);
static void termp_bd_post(DECL_ARGS);
+static void termp_bk_post(DECL_ARGS);
static void termp_bl_post(DECL_ARGS);
static void termp_bq_post(DECL_ARGS);
static void termp_brq_post(DECL_ARGS);
@@ -97,6 +98,7 @@ static int termp_ap_pre(DECL_ARGS);
static int termp_aq_pre(DECL_ARGS);
static int termp_bd_pre(DECL_ARGS);
static int termp_bf_pre(DECL_ARGS);
+static int termp_bk_pre(DECL_ARGS);
static int termp_bl_pre(DECL_ARGS);
static int termp_bold_pre(DECL_ARGS);
static int termp_bq_pre(DECL_ARGS);
@@ -236,7 +238,7 @@ static const struct termact termacts[MDOC_MAX] = {
{ NULL, NULL }, /* Fc */
{ termp_op_pre, termp_op_post }, /* Oo */
{ NULL, NULL }, /* Oc */
- { NULL, NULL }, /* Bk */
+ { termp_bk_pre, termp_bk_post }, /* Bk */
{ NULL, NULL }, /* Ek */
{ termp_bt_pre, NULL }, /* Bt */
{ NULL, NULL }, /* Hf */
@@ -2104,6 +2106,24 @@ termp_lk_pre(DECL_ARGS)
/* ARGSUSED */
static int
+termp_bk_pre(DECL_ARGS)
+{
+
+ p->flags |= TERMP_PREKEEP;
+ return(1);
+}
+
+
+/* ARGSUSED */
+static void
+termp_bk_post(DECL_ARGS)
+{
+
+ p->flags &= ~(TERMP_KEEP | TERMP_PREKEEP);
+}
+
+/* ARGSUSED */
+static int
termp_under_pre(DECL_ARGS)
{