From 6a5d7b3417c42d71e00a671bdca73c0a15c8368a Mon Sep 17 00:00:00 2001 From: Ingo Schwarze Date: Fri, 23 Jan 2015 14:21:01 +0000 Subject: 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). --- mdoc_html.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'mdoc_html.c') diff --git a/mdoc_html.c b/mdoc_html.c index 137a763f..f7ce59e8 100644 --- a/mdoc_html.c +++ b/mdoc_html.c @@ -1,7 +1,7 @@ -/* $Id: mdoc_html.c,v 1.218 2014/12/23 13:48:57 schwarze Exp $ */ +/* $Id: mdoc_html.c,v 1.219 2015/01/23 14:21:01 schwarze Exp $ */ /* * 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 */ -- cgit v1.2.3