From c34ffa6e23ff98f676ad6e130a07a8543a268f2e Mon Sep 17 00:00:00 2001 From: Ingo Schwarze Date: Mon, 25 Apr 2011 00:03:07 +0000 Subject: Closing delimiters only suppress spacing when they follow something. Fixing a regression introduced in rev. 1.105. ok and prodding for comments kristaps@. --- mdoc_macro.c | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) (limited to 'mdoc_macro.c') diff --git a/mdoc_macro.c b/mdoc_macro.c index 7155cf2c..472a55f2 100644 --- a/mdoc_macro.c +++ b/mdoc_macro.c @@ -1,4 +1,4 @@ -/* $Id: mdoc_macro.c,v 1.107 2011/04/19 16:38:48 kristaps Exp $ */ +/* $Id: mdoc_macro.c,v 1.108 2011/04/25 00:03:07 schwarze Exp $ */ /* * Copyright (c) 2008, 2009, 2010 Kristaps Dzonsons * Copyright (c) 2010 Ingo Schwarze @@ -600,7 +600,19 @@ dword(struct mdoc *m, int line, if (DELIM_OPEN == d) m->last->flags |= MDOC_DELIMO; - else if (DELIM_CLOSE == d) + + /* + * Closing delimiters only suppress the preceding space + * when they follow something, not when they start a new + * block or element, and not when they follow `No'. + * + * XXX Explicitly special-casing MDOC_No here feels + * like a layering violation. Find a better way + * and solve this in the code related to `No'! + */ + + else if (DELIM_CLOSE == d && m->last->prev && + m->last->prev->tok != MDOC_No) m->last->flags |= MDOC_DELIMC; return(1); -- cgit v1.2.3-56-ge451