On Friday 23 November 2018 20:30:09 Ingo Schwarze wrote: > Hi Pali, > > Pali Rohar wrote on Thu, Nov 22, 2018 at 03:24:28PM +0100: > > > $ printf "%s\ntest test test test test %s\n" \ > > 'Name (\fItest@example.org\fR)' 'Name (\fItest@example.org\fR)' \ > > | mandoc -T html > > > > I got following output: > > > >
Name (test@example.org) test test test test test > > Name ( test@example.org)
> > > > > > First Name is correct, second Name not. > > Ah. Yes, i can reproduce that on -current. > > It wasn't even related to parentheses. I just spotted it on lot of places around email addresses generated by pod2man, therefore I thought it is related to parentheses around. > The bug simply caused output > of whitespace in the middle of words when there were font escape > sequences - though not always. Whether the bug hit depended on the > spacing mode before the word containing the font escape, which made > it a bit elusive. > > Fixed in the following commit. > > Thanks for reporting the bug, > Ingo Thanks for fix! > > Log Message: > ----------- > 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. > > Modified Files: > -------------- > mandoc: > html.c > > Revision Data > ------------- > Index: html.c > =================================================================== > RCS file: /home/cvs/mandoc/mandoc/html.c,v > retrieving revision 1.242 > retrieving revision 1.243 > diff -Lhtml.c -Lhtml.c -u -p -r1.242 -r1.243 > --- html.c > +++ html.c > @@ -416,8 +416,11 @@ print_encode(struct html *h, const char > 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; -- Pali Rohár pali.rohar@gmail.com