Print this page
9718 update mandoc to 1.14.4

*** 1,9 **** ! /* $Id: mdoc_term.c,v 1.364 2017/06/14 17:51:15 schwarze Exp $ */ /* * Copyright (c) 2008, 2009, 2010, 2011 Kristaps Dzonsons <kristaps@bsd.lv> ! * Copyright (c) 2010, 2012-2017 Ingo Schwarze <schwarze@openbsd.org> * Copyright (c) 2013 Franco Fichtner <franco@lastsummer.de> * * Permission to use, copy, modify, and distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. --- 1,9 ---- ! /* $Id: mdoc_term.c,v 1.367 2018/04/11 17:11:13 schwarze Exp $ */ /* * Copyright (c) 2008, 2009, 2010, 2011 Kristaps Dzonsons <kristaps@bsd.lv> ! * Copyright (c) 2010, 2012-2018 Ingo Schwarze <schwarze@openbsd.org> * Copyright (c) 2013 Franco Fichtner <franco@lastsummer.de> * * Permission to use, copy, modify, and distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies.
*** 281,291 **** save_defindent = p->defindent; if (p->defindent == 0) p->defindent = 5; term_begin(p, print_mdoc_head, print_mdoc_foot, &mdoc->meta); ! while (n != NULL && n->flags & NODE_NOPRT) n = n->next; if (n != NULL) { if (n->tok != MDOC_Sh) term_vspace(p); print_mdoc_nodelist(p, NULL, &mdoc->meta, n); --- 281,293 ---- save_defindent = p->defindent; if (p->defindent == 0) p->defindent = 5; term_begin(p, print_mdoc_head, print_mdoc_foot, &mdoc->meta); ! while (n != NULL && ! (n->type == ROFFT_COMMENT || ! n->flags & NODE_NOPRT)) n = n->next; if (n != NULL) { if (n->tok != MDOC_Sh) term_vspace(p); print_mdoc_nodelist(p, NULL, &mdoc->meta, n);
*** 310,320 **** { int chld; struct termpair npair; size_t offset, rmargin; ! if (n->flags & NODE_NOPRT) return; chld = 1; offset = p->tcol->offset; rmargin = p->tcol->rmargin; --- 312,322 ---- { int chld; struct termpair npair; size_t offset, rmargin; ! if (n->type == ROFFT_COMMENT || n->flags & NODE_NOPRT) return; chld = 1; offset = p->tcol->offset; rmargin = p->tcol->rmargin;
*** 565,575 **** return; /* Do not vspace directly after Ss/Sh. */ nn = n; ! while (nn->prev != NULL && nn->prev->flags & NODE_NOPRT) nn = nn->prev; while (nn->prev == NULL) { do { nn = nn->parent; if (nn->type == ROFFT_ROOT) --- 567,579 ---- return; /* Do not vspace directly after Ss/Sh. */ nn = n; ! while (nn->prev != NULL && ! (nn->prev->type == ROFFT_COMMENT || ! nn->prev->flags & NODE_NOPRT)) nn = nn->prev; while (nn->prev == NULL) { do { nn = nn->parent; if (nn->type == ROFFT_ROOT)
*** 1548,1558 **** switch (n->type) { case ROFFT_BLOCK: term_newln(p); for (nn = n->prev; nn != NULL; nn = nn->prev) ! if ((nn->flags & NODE_NOPRT) == 0) break; if (nn != NULL) term_vspace(p); break; case ROFFT_HEAD: --- 1552,1563 ---- switch (n->type) { case ROFFT_BLOCK: term_newln(p); for (nn = n->prev; nn != NULL; nn = nn->prev) ! if (nn->type != ROFFT_COMMENT && ! (nn->flags & NODE_NOPRT) == 0) break; if (nn != NULL) term_vspace(p); break; case ROFFT_HEAD:
*** 1662,1672 **** break; case MDOC__T: /* FALLTHROUGH */ case MDOC_Do: case MDOC_Dq: ! term_word(p, "\\(Lq"); break; case MDOC_En: if (NULL == n->norm->Es || NULL == n->norm->Es->child) return 1; --- 1667,1677 ---- break; case MDOC__T: /* FALLTHROUGH */ case MDOC_Do: case MDOC_Dq: ! term_word(p, "\\(lq"); break; case MDOC_En: if (NULL == n->norm->Es || NULL == n->norm->Es->child) return 1;
*** 1720,1730 **** break; case MDOC__T: /* FALLTHROUGH */ case MDOC_Do: case MDOC_Dq: ! term_word(p, "\\(Rq"); break; case MDOC_En: if (n->norm->Es == NULL || n->norm->Es->child == NULL || n->norm->Es->child->next == NULL) --- 1725,1735 ---- break; case MDOC__T: /* FALLTHROUGH */ case MDOC_Do: case MDOC_Dq: ! term_word(p, "\\(rq"); break; case MDOC_En: if (n->norm->Es == NULL || n->norm->Es->child == NULL || n->norm->Es->child->next == NULL)
*** 1938,1948 **** static int termp_lk_pre(DECL_ARGS) { const struct roff_node *link, *descr, *punct; - int display; if ((link = n->child) == NULL) return 0; /* Find beginning of trailing punctuation. */ --- 1943,1952 ----
*** 1964,1978 **** p->flags |= TERMP_NOSPACE; term_word(p, ":"); } /* Link target. */ - display = term_strlen(p, link->string) >= 26; - if (display) { - term_newln(p); - p->tcol->offset += term_len(p, p->defindent + 1); - } term_fontpush(p, TERMFONT_BOLD); term_word(p, link->string); term_fontpop(p); /* Trailing punctuation. */ --- 1968,1977 ----
*** 1979,1990 **** while (punct != NULL) { p->flags |= TERMP_NOSPACE; term_word(p, punct->string); punct = punct->next; } - if (display) - term_newln(p); return 0; } static int termp_bk_pre(DECL_ARGS) --- 1978,1987 ----