diff options
Diffstat (limited to 'mdoc_man.c')
| -rw-r--r-- | mdoc_man.c | 47 | 
1 files changed, 29 insertions, 18 deletions
diff --git a/mdoc_man.c b/mdoc_man.c index 230b36856837..cf552ce902bb 100644 --- a/mdoc_man.c +++ b/mdoc_man.c @@ -1,4 +1,4 @@ -/*	$Id: mdoc_man.c,v 1.119 2017/06/08 12:54:58 schwarze Exp $ */ +/*	$Id: mdoc_man.c,v 1.122 2017/06/14 22:51:25 schwarze Exp $ */  /*   * Copyright (c) 2011-2017 Ingo Schwarze <schwarze@openbsd.org>   * @@ -125,14 +125,16 @@ static	void	  print_count(int *);  static	void	  print_node(DECL_ARGS);  static	const void_fp roff_manacts[ROFF_MAX] = { -	pre_br, -	pre_onearg, -	pre_ft, -	pre_onearg, -	pre_onearg, -	pre_sp, -	pre_ta, -	pre_onearg, +	pre_br,		/* br */ +	pre_onearg,	/* ce */ +	pre_ft,		/* ft */ +	pre_onearg,	/* ll */ +	pre_onearg,	/* mc */ +	pre_onearg,	/* po */ +	pre_onearg,	/* rj */ +	pre_sp,		/* sp */ +	pre_ta,		/* ta */ +	pre_onearg,	/* ti */  };  static	const struct manact __manacts[MDOC_MAX - MDOC_Dd] = { @@ -196,8 +198,8 @@ static	const struct manact __manacts[MDOC_MAX - MDOC_Dd] = {  	{ NULL, pre_bf, post_bf, NULL, NULL }, /* Bf */  	{ cond_body, pre_enc, post_enc, "[", "]" }, /* Bo */  	{ cond_body, pre_enc, post_enc, "[", "]" }, /* Bq */ -	{ NULL, NULL, NULL, NULL, NULL }, /* Bsx */ -	{ NULL, NULL, NULL, NULL, NULL }, /* Bx */ +	{ NULL, pre_bk, post_bk, NULL, NULL }, /* Bsx */ +	{ NULL, pre_bk, post_bk, NULL, NULL }, /* Bx */  	{ NULL, pre_skip, NULL, NULL, NULL }, /* Db */  	{ NULL, NULL, NULL, NULL, NULL }, /* Dc */  	{ cond_body, pre_enc, post_enc, "\\(Lq", "\\(Rq" }, /* Do */ @@ -206,12 +208,12 @@ static	const struct manact __manacts[MDOC_MAX - MDOC_Dd] = {  	{ NULL, NULL, NULL, NULL, NULL }, /* Ef */  	{ NULL, pre_em, post_font, NULL, NULL }, /* Em */  	{ cond_body, pre_eo, post_eo, NULL, NULL }, /* Eo */ -	{ NULL, NULL, NULL, NULL, NULL }, /* Fx */ +	{ NULL, pre_bk, post_bk, NULL, NULL }, /* Fx */  	{ NULL, pre_sy, post_font, NULL, NULL }, /* Ms */  	{ NULL, pre_no, NULL, NULL, NULL }, /* No */  	{ NULL, pre_ns, NULL, NULL, NULL }, /* Ns */ -	{ NULL, NULL, NULL, NULL, NULL }, /* Nx */ -	{ NULL, NULL, NULL, NULL, NULL }, /* Ox */ +	{ NULL, pre_bk, post_bk, NULL, NULL }, /* Nx */ +	{ NULL, pre_bk, post_bk, NULL, NULL }, /* Ox */  	{ NULL, NULL, NULL, NULL, NULL }, /* Pc */  	{ NULL, NULL, post_pf, NULL, NULL }, /* Pf */  	{ cond_body, pre_enc, post_enc, "(", ")" }, /* Po */ @@ -252,7 +254,7 @@ static	const struct manact __manacts[MDOC_MAX - MDOC_Dd] = {  	{ NULL, NULL, post_percent, NULL, NULL }, /* %C */  	{ NULL, pre_skip, NULL, NULL, NULL }, /* Es */  	{ cond_body, pre_en, post_en, NULL, NULL }, /* En */ -	{ NULL, NULL, NULL, NULL, NULL }, /* Dx */ +	{ NULL, pre_bk, post_bk, NULL, NULL }, /* Dx */  	{ NULL, NULL, post_percent, NULL, NULL }, /* %Q */  	{ NULL, NULL, post_percent, NULL, NULL }, /* %U */  	{ NULL, NULL, NULL, NULL, NULL }, /* Ta */ @@ -990,11 +992,11 @@ post_bf(DECL_ARGS)  static int  pre_bk(DECL_ARGS)  { -  	switch (n->type) {  	case ROFFT_BLOCK:  		return 1;  	case ROFFT_BODY: +	case ROFFT_ELEM:  		outflags |= MMAN_Bk;  		return 1;  	default: @@ -1005,9 +1007,18 @@ pre_bk(DECL_ARGS)  static void  post_bk(DECL_ARGS)  { - -	if (n->type == ROFFT_BODY) +	switch (n->type) { +	case ROFFT_ELEM: +		while ((n = n->parent) != NULL) +			 if (n->tok == MDOC_Bk) +				return; +		/* FALLTHROUGH */ +	case ROFFT_BODY:  		outflags &= ~MMAN_Bk; +		break; +	default: +		break; +	}  }  static int  | 
