summaryrefslogtreecommitdiffstats
path: root/eqn_term.c
diff options
context:
space:
mode:
authorIngo Schwarze <schwarze@openbsd.org>2017-08-23 20:29:42 +0000
committerIngo Schwarze <schwarze@openbsd.org>2017-08-23 20:29:42 +0000
commit12117bdb06c2ea3ee37d7508ce54c9626b3701a9 (patch)
tree5e1e9ebe993f155473fcf70dd4b88a9b58da11b3 /eqn_term.c
parent557780bebdb6f646d2fa26cb84847307fe45918b (diff)
downloadmandoc-12117bdb06c2ea3ee37d7508ce54c9626b3701a9.tar.gz
eliminate white space after opening and before closing punctuation
Diffstat (limited to 'eqn_term.c')
-rw-r--r--eqn_term.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/eqn_term.c b/eqn_term.c
index e41ab32e..69c77409 100644
--- a/eqn_term.c
+++ b/eqn_term.c
@@ -90,8 +90,14 @@ eqn_box(struct termp *p, const struct eqn_box *bp)
if (bp->font != EQNFONT_NONE)
term_fontpush(p, fontmap[(int)bp->font]);
- if (bp->text != NULL)
+ if (bp->text != NULL) {
+ if (strchr("!\"'),.:;?]}", *bp->text) != NULL)
+ p->flags |= TERMP_NOSPACE;
term_word(p, bp->text);
+ if (*bp->text != '\0' && strchr("\"'([{",
+ bp->text[strlen(bp->text) - 1]) != NULL)
+ p->flags |= TERMP_NOSPACE;
+ }
/* Special box types. */