summaryrefslogtreecommitdiffstats
path: root/html.c
diff options
context:
space:
mode:
authorIngo Schwarze <schwarze@openbsd.org>2018-11-23 19:17:05 +0000
committerIngo Schwarze <schwarze@openbsd.org>2018-11-23 19:17:05 +0000
commit37756bb69b45c6e10a934e8b40cab0cb8e614fab (patch)
tree73a6f193ac90222add789518f4ff9b217a8087c4 /html.c
parentff5d8eb0330aa41fed303bf6c942ce2cb663a51e (diff)
downloadmandoc-37756bb69b45c6e10a934e8b40cab0cb8e614fab.tar.gz
When a font escape appears in the middle of a string,
make sure it doesn't cause output of bogus whitespace. Fixing a bug reported by Pali dot Rohar at gmail dot com.
Diffstat (limited to 'html.c')
-rw-r--r--html.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/html.c b/html.c
index 6d984717..715d0dd1 100644
--- a/html.c
+++ b/html.c
@@ -416,8 +416,11 @@ print_encode(struct html *h, const char *p, const char *pend, int norecurse)
case ESCAPE_FONTBI:
case ESCAPE_FONTCW:
case ESCAPE_FONTROMAN:
- if (0 == norecurse)
+ if (0 == norecurse) {
+ h->flags |= HTML_NOSPACE;
print_metaf(h, esc);
+ h->flags &= ~HTML_NOSPACE;
+ }
continue;
case ESCAPE_SKIPCHAR:
h->flags |= HTML_SKIPCHAR;