discuss@mandoc.bsd.lv
 help / color / mirror / Atom feed
From: Kristaps Dzonsons <kristaps@bsd.lv>
To: discuss@mdocml.bsd.lv
Subject: Re: Render POD =head3 $c->uri
Date: Thu, 03 Nov 2011 15:59:51 +0100	[thread overview]
Message-ID: <4EB2AC67.1080706@bsd.lv> (raw)
In-Reply-To: <4EB2ABF2.70805@bsd.lv>

[-- Attachment #1: Type: text/plain, Size: 699 bytes --]

On 11/03/11 15:57, Kristaps Dzonsons wrote:
>> when I run the following commands, the text "$c->uri" is fully
>> underlined if the manual page is formatted with nroff. If the manual
>> page is formatted with mandoc, only the text "->uri" is underlined.
>>
>> echo '=head3 $c->uri' | pod2man | nroff -man | less -R
>> echo '=head3 $c->uri' | pod2man | mandoc | less -R
>>
>> Noticed on OpenBSD-current.
>
> Hi Andreas,
>
> The enclosed patch fixes this issue: since the 4.9 release, we've become
> more strict. I've now added the correct magic for `\f(Cx' escapes as
> dictated by groff(7) and your example works fine.
>
> Oks?

Gah.  Unified diff now (stupid default behaviour of non-unified diff).

[-- Attachment #2: patch.txt --]
[-- Type: text/plain, Size: 1185 bytes --]

Index: mandoc.c
===================================================================
RCS file: /usr/vhosts/mdocml.bsd.lv/cvs/mdocml/mandoc.c,v
retrieving revision 1.60
diff -u -r1.60 mandoc.c
--- mandoc.c	24 Oct 2011 20:30:57 -0000	1.60
+++ mandoc.c	3 Nov 2011 14:59:14 -0000
@@ -369,8 +369,15 @@
 
 	switch (gly) {
 	case (ESCAPE_FONT):
-		if (1 != rlim)
+		/*
+		 * Pretend that the constant-width font modes are the
+		 * same as the regular font modes.
+		 */
+		if (2 == rlim && 'C' == *rstart)
+			rstart++;
+		else if (1 != rlim)
 			break;
+
 		switch (*rstart) {
 		case ('3'):
 			/* FALLTHROUGH */
Index: roff.7
===================================================================
RCS file: /usr/vhosts/mdocml.bsd.lv/cvs/mdocml/roff.7,v
retrieving revision 1.33
diff -u -r1.33 roff.7
--- roff.7	26 Sep 2011 23:07:31 -0000	1.33
+++ roff.7	3 Nov 2011 14:59:14 -0000
@@ -143,6 +143,8 @@
 (revert to previous mode).
 A numerical representation 3, 2, or 1 (bold, italic, and regular,
 respectively) may be used instead.
+The indicator or numerical representative may be preceded by C
+(constant-width), which is ignored.
 .Pp
 Examples:
 .Bl -tag -width Ds -offset indent -compact

  reply	other threads:[~2011-11-03 14:59 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-11-03 14:39 Andreas Vögele
2011-11-03 14:57 ` Kristaps Dzonsons
2011-11-03 14:59   ` Kristaps Dzonsons [this message]
2011-11-03 19:18   ` Andreas Vögele

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=4EB2AC67.1080706@bsd.lv \
    --to=kristaps@bsd.lv \
    --cc=discuss@mdocml.bsd.lv \
    /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).