=================================================================== RCS file: /cvs/mandoc/mdoc_macro.c,v retrieving revision 1.231 retrieving revision 1.234 diff -u -p -r1.231 -r1.234 --- mandoc/mdoc_macro.c 2019/01/01 07:42:04 1.231 +++ mandoc/mdoc_macro.c 2020/01/19 18:02:00 1.234 @@ -1,7 +1,7 @@ -/* $Id: mdoc_macro.c,v 1.231 2019/01/01 07:42:04 schwarze Exp $ */ +/* $Id: mdoc_macro.c,v 1.234 2020/01/19 18:02:00 schwarze Exp $ */ /* * Copyright (c) 2008-2012 Kristaps Dzonsons - * Copyright (c) 2010, 2012-2019 Ingo Schwarze + * Copyright (c) 2010, 2012-2020 Ingo Schwarze * * Permission to use, copy, modify, and distribute this software for any * purpose with or without fee is hereby granted, provided that the above @@ -61,7 +61,7 @@ static void rew_pending(struct roff_man *, const struct roff_node *); static const struct mdoc_macro mdoc_macros[MDOC_MAX - MDOC_Dd] = { - { in_line_eoln, MDOC_PROLOGUE }, /* Dd */ + { in_line_eoln, MDOC_PROLOGUE | MDOC_JOIN }, /* Dd */ { in_line_eoln, MDOC_PROLOGUE }, /* Dt */ { in_line_eoln, MDOC_PROLOGUE }, /* Os */ { blk_full, MDOC_PARSED | MDOC_JOIN }, /* Sh */ @@ -200,6 +200,7 @@ static const struct mdoc_macro mdoc_macros[MDOC_MAX - { in_line_eoln, MDOC_JOIN }, /* %Q */ { in_line_eoln, 0 }, /* %U */ { phrase_ta, MDOC_CALLABLE | MDOC_PARSED | MDOC_JOIN }, /* Ta */ + { in_line_eoln, 0 }, /* Tg */ }; @@ -295,6 +296,8 @@ rew_pending(struct roff_man *mdoc, const struct roff_n case ROFFT_HEAD: roff_body_alloc(mdoc, n->line, n->pos, n->tok); + if (n->tok == MDOC_Ss) + mdoc->flags &= ~ROFF_NONOFILL; break; case ROFFT_BLOCK: break; @@ -1053,9 +1056,16 @@ blk_full(MACRO_PROT_ARGS) * regular child nodes. */ - if (tok == MDOC_Sh) + switch (tok) { + case MDOC_Sh: mdoc->flags &= ~ROFF_NOFILL; - + break; + case MDOC_Ss: + mdoc->flags |= ROFF_NONOFILL; + break; + default: + break; + } mdoc_argv(mdoc, line, tok, &arg, pos, buf); blk = mdoc_block_alloc(mdoc, line, ppos, tok, arg); head = body = NULL; @@ -1197,6 +1207,8 @@ blk_full(MACRO_PROT_ARGS) rew_last(mdoc, head); body = roff_body_alloc(mdoc, line, ppos, tok); + if (tok == MDOC_Ss) + mdoc->flags &= ~ROFF_NONOFILL; /* * Set up fill mode for display blocks.