From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from localhost (fantadrom.bsd.lv [local]); by fantadrom.bsd.lv (OpenSMTPD) with ESMTPA id 49b8ae61; for ; Fri, 23 Jan 2015 09:21:32 -0500 (EST) Date: Fri, 23 Jan 2015 09:21:32 -0500 (EST) Message-Id: <413805362403231189.enqueue@fantadrom.bsd.lv> X-Mailinglist: mdocml-source Reply-To: source@mdocml.bsd.lv MIME-Version: 1.0 From: schwarze@mdocml.bsd.lv To: source@mdocml.bsd.lv Subject: mdocml: Let .Aq/.Ao/.Ac print "<>" instead of the normal "\(la\(ra" X-Mailer: activitymail 1.26, http://search.cpan.org/dist/activitymail/ Content-Type: text/plain; charset=utf-8 Log Message: ----------- Let .Aq/.Ao/.Ac print "<>" instead of the normal "\(la\(ra" when the only child is .Mt, not when the preceding node is .An, to improve robustness. Triggered by a question from Svyatoslav Mishyn (Crux Linux). Modified Files: -------------- mdocml: mdoc_html.c mdoc_man.c mdoc_term.c Revision Data ------------- Index: mdoc_man.c =================================================================== RCS file: /home/cvs/mdocml/mdocml/mdoc_man.c,v retrieving revision 1.81 retrieving revision 1.82 diff -Lmdoc_man.c -Lmdoc_man.c -u -p -r1.81 -r1.82 --- mdoc_man.c +++ mdoc_man.c @@ -1,6 +1,6 @@ /* $Id$ */ /* - * Copyright (c) 2011, 2012, 2013, 2014 Ingo Schwarze + * Copyright (c) 2011-2015 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 @@ -879,8 +879,8 @@ static int pre_aq(DECL_ARGS) { - print_word(n->parent->prev != NULL && - n->parent->prev->tok == MDOC_An ? "<" : "\\(la"); + print_word(n->nchild == 1 && + n->child->tok == MDOC_Mt ? "<" : "\\(la"); outflags &= ~MMAN_spc; return(1); } @@ -890,8 +890,8 @@ post_aq(DECL_ARGS) { outflags &= ~(MMAN_spc | MMAN_nl); - print_word(n->parent->prev != NULL && - n->parent->prev->tok == MDOC_An ? ">" : "\\(ra"); + print_word(n->nchild == 1 && + n->child->tok == MDOC_Mt ? ">" : "\\(ra"); } static int Index: mdoc_html.c =================================================================== RCS file: /home/cvs/mdocml/mdocml/mdoc_html.c,v retrieving revision 1.218 retrieving revision 1.219 diff -Lmdoc_html.c -Lmdoc_html.c -u -p -r1.218 -r1.219 --- mdoc_html.c +++ mdoc_html.c @@ -1,7 +1,7 @@ /* $Id$ */ /* * Copyright (c) 2008-2011, 2014 Kristaps Dzonsons - * Copyright (c) 2014 Ingo Schwarze + * Copyright (c) 2014, 2015 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 @@ -2084,8 +2084,8 @@ mdoc_quote_pre(MDOC_ARGS) case MDOC_Ao: /* FALLTHROUGH */ case MDOC_Aq: - print_text(h, n->parent->prev != NULL && - n->parent->prev->tok == MDOC_An ? "<" : "\\(la"); + print_text(h, n->nchild == 1 && + n->child->tok == MDOC_Mt ? "<" : "\\(la"); break; case MDOC_Bro: /* FALLTHROUGH */ @@ -2162,8 +2162,8 @@ mdoc_quote_post(MDOC_ARGS) case MDOC_Ao: /* FALLTHROUGH */ case MDOC_Aq: - print_text(h, n->parent->prev != NULL && - n->parent->prev->tok == MDOC_An ? ">" : "\\(ra"); + print_text(h, n->nchild == 1 && + n->child->tok == MDOC_Mt ? ">" : "\\(ra"); break; case MDOC_Bro: /* FALLTHROUGH */ Index: mdoc_term.c =================================================================== RCS file: /home/cvs/mdocml/mdocml/mdoc_term.c,v retrieving revision 1.302 retrieving revision 1.303 diff -Lmdoc_term.c -Lmdoc_term.c -u -p -r1.302 -r1.303 --- mdoc_term.c +++ mdoc_term.c @@ -1,7 +1,7 @@ /* $Id$ */ /* * Copyright (c) 2008, 2009, 2010, 2011 Kristaps Dzonsons - * Copyright (c) 2010, 2012, 2013, 2014 Ingo Schwarze + * Copyright (c) 2010, 2012-2015 Ingo Schwarze * Copyright (c) 2013 Franco Fichtner * * Permission to use, copy, modify, and distribute this software for any @@ -1855,8 +1855,8 @@ termp_quote_pre(DECL_ARGS) case MDOC_Ao: /* FALLTHROUGH */ case MDOC_Aq: - term_word(p, n->parent->prev != NULL && - n->parent->prev->tok == MDOC_An ? "<" : "\\(la"); + term_word(p, n->nchild == 1 && + n->child->tok == MDOC_Mt ? "<" : "\\(la"); break; case MDOC_Bro: /* FALLTHROUGH */ @@ -1928,8 +1928,8 @@ termp_quote_post(DECL_ARGS) case MDOC_Ao: /* FALLTHROUGH */ case MDOC_Aq: - term_word(p, n->parent->prev != NULL && - n->parent->prev->tok == MDOC_An ? ">" : "\\(ra"); + term_word(p, n->nchild == 1 && + n->child->tok == MDOC_Mt ? ">" : "\\(ra"); break; case MDOC_Bro: /* FALLTHROUGH */ -- To unsubscribe send an email to source+unsubscribe@mdocml.bsd.lv