aboutsummaryrefslogtreecommitdiffstatshomepage
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
commit24fe7406bbfb6590bc86873c1ddd6507258c41d8 (patch)
treea3eb5174fdf0ff252517c1040acf2348f934224b /html.c
parent5222bf5d62c70c6ef855e9c51d578d55cd377832 (diff)
downloadmandoc-24fe7406bbfb6590bc86873c1ddd6507258c41d8.tar.gz
mandoc-24fe7406bbfb6590bc86873c1ddd6507258c41d8.tar.zst
mandoc-24fe7406bbfb6590bc86873c1ddd6507258c41d8.zip
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.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/html.c b/html.c
index 49f00326..63b93c0b 100644
--- a/html.c
+++ b/html.c
@@ -1,4 +1,4 @@
-/* $Id: html.c,v 1.242 2018/10/25 01:32:40 schwarze Exp $ */
+/* $Id: html.c,v 1.243 2018/11/23 19:17:05 schwarze Exp $ */
/*
* Copyright (c) 2008-2011, 2014 Kristaps Dzonsons <kristaps@bsd.lv>
* Copyright (c) 2011-2015, 2017, 2018 Ingo Schwarze <schwarze@openbsd.org>
@@ -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;