summaryrefslogtreecommitdiff
path: root/help2man.PL
diff options
context:
space:
mode:
authorBrendan O'Dea <bod@debian.org>2014-03-24 22:40:29 +1100
committerBrendan O'Dea <bod@debian.org>2014-03-24 22:40:29 +1100
commitfa847ea540224c1e343fb5f4d3b72e28e273e38a (patch)
treef8fd9f1ca08e9d0c0d245a9d4eb79f2186d3b605 /help2man.PL
parente39057999bc89424a91f1cc22f0abb3c74385527 (diff)
downloadhelp2man-fa847ea540224c1e343fb5f4d3b72e28e273e38a.tar.gz
Add escapes to adjust spacing of italic text at roman/italic boundariesv1.45.1
Diffstat (limited to 'help2man.PL')
-rwxr-xr-xhelp2man.PL13
1 files changed, 13 insertions, 0 deletions
diff --git a/help2man.PL b/help2man.PL
index 1b809b6..14d014f 100755
--- a/help2man.PL
+++ b/help2man.PL
@@ -157,6 +157,7 @@ sub N_ { $_[0] }
sub program_basename;
sub get_option_value;
sub convert_option;
+sub fix_italic_spacing;
my $version_info = enc_user sprintf _(<<'EOT'), $this_program, $this_version;
GNU %s %s
@@ -491,6 +492,7 @@ if ($help_text =~ s/^($PAT_USAGE):( +(\S+))(.*)((?:\n(?: {6}\1| *($PAT_USAGE_CON
s/\\fI$//;
s/^\./\\&./;
+ $_ = fix_italic_spacing $_;
$synopsis .= "$_\n";
}
@@ -695,6 +697,8 @@ while (length)
)
($|[ ,;.)]) # space/punctuation after
!$1\\fI$2\\fP$3!xmg;
+
+ $_ = fix_italic_spacing $_;
}
# Escape remaining hyphens.
@@ -860,6 +864,15 @@ sub convert_option
$_;
}
+
+# Insert spacing escape characters \, and \/ before and after italic text. See
+# http://www.gnu.org/software/groff/manual/html_node/Ligatures-and-Kerning.html
+sub fix_italic_spacing
+{
+ local $_ = shift;
+ s!\\fI(.*?)\\f([BRP])!\\fI\\,$1\\/\\f$2!g;
+ return $_;
+}
!NO!SUBS!
# Rename output and fix permissions