discuss@mandoc.bsd.lv
 help / color / mirror / Atom feed
From: Ingo Schwarze <schwarze@usta.de>
To: Pali Rohar <pali.rohar@gmail.com>
Cc: discuss@mandoc.bsd.lv
Subject: Re: Undesirable space after parenthesis in HTML output
Date: Fri, 23 Nov 2018 20:30:09 +0100	[thread overview]
Message-ID: <20181123193009.GA7177@athene.usta.de> (raw)
In-Reply-To: <20181122142428.icetmrw6zptlsb3c@pali>

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:
> 
> <div class="manual-text">Name (<i>test@example.org</i>) test test test test test
>   Name ( <i>test@example.org</i>)</div>
> <table class="foot">
> 
> First Name is correct, second Name not.

Ah.  Yes, i can reproduce that on -current.

It wasn't even related to parentheses.  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


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;
--
 To unsubscribe send an email to discuss+unsubscribe@mandoc.bsd.lv

  reply	other threads:[~2018-11-23 19:30 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-11-05 20:03 Pali Rohár
2018-11-22 14:08 ` Ingo Schwarze
2018-11-22 14:24   ` Pali Rohár
2018-11-23 19:30     ` Ingo Schwarze [this message]
2018-11-23 20:22       ` Pali Rohár

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20181123193009.GA7177@athene.usta.de \
    --to=schwarze@usta.de \
    --cc=discuss@mandoc.bsd.lv \
    --cc=pali.rohar@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).