aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/mdoc_macro.c
diff options
context:
space:
mode:
authorIngo Schwarze <schwarze@openbsd.org>2011-04-25 00:03:07 +0000
committerIngo Schwarze <schwarze@openbsd.org>2011-04-25 00:03:07 +0000
commitc34ffa6e23ff98f676ad6e130a07a8543a268f2e (patch)
tree5cd7f03b517ae6565d1e86d8825fcf9704dc1141 /mdoc_macro.c
parent38e9ca6f18d04678d360f464a272f9866b42e4a4 (diff)
downloadmandoc-c34ffa6e23ff98f676ad6e130a07a8543a268f2e.tar.gz
mandoc-c34ffa6e23ff98f676ad6e130a07a8543a268f2e.tar.zst
mandoc-c34ffa6e23ff98f676ad6e130a07a8543a268f2e.zip
Closing delimiters only suppress spacing when they follow something.
Fixing a regression introduced in rev. 1.105. ok and prodding for comments kristaps@.
Diffstat (limited to 'mdoc_macro.c')
-rw-r--r--mdoc_macro.c16
1 files changed, 14 insertions, 2 deletions
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 <kristaps@bsd.lv>
* Copyright (c) 2010 Ingo Schwarze <schwarze@openbsd.org>
@@ -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);