diff options
author | Ingo Schwarze <schwarze@openbsd.org> | 2015-01-23 14:21:01 +0000 |
---|---|---|
committer | Ingo Schwarze <schwarze@openbsd.org> | 2015-01-23 14:21:01 +0000 |
commit | 5cdc25331345b85829cb16411bb48b213b6ea7b1 (patch) | |
tree | 51bc59d705467014a8598b01b008c8261118c4e6 /mdoc_html.c | |
parent | 1c07d0670659745601b58f021984f85c38c41f44 (diff) | |
download | mandoc-5cdc25331345b85829cb16411bb48b213b6ea7b1.tar.gz |
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 <juef at openmailbox dot org> (Crux Linux).
Diffstat (limited to 'mdoc_html.c')
-rw-r--r-- | mdoc_html.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/mdoc_html.c b/mdoc_html.c index 885565e3..6165050e 100644 --- a/mdoc_html.c +++ b/mdoc_html.c @@ -1,7 +1,7 @@ /* $Id$ */ /* * Copyright (c) 2008-2011, 2014 Kristaps Dzonsons <kristaps@bsd.lv> - * Copyright (c) 2014 Ingo Schwarze <schwarze@openbsd.org> + * Copyright (c) 2014, 2015 Ingo Schwarze <schwarze@openbsd.org> * * 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 */ |