Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 7 additions & 2 deletions lib/Pod/Man.pm
Original file line number Diff line number Diff line change
Expand Up @@ -419,6 +419,7 @@ sub _handle_element_start {
# first heading after the NAME heading.
if ($self->can ("cmd_$method")) {
$$self{IN_NAME} = 0 if ($element ne 'Para' && length ($element) > 1);
$$self{IN_LINK} = $element eq "L";

# How we're going to format embedded text blocks depends on the tag
# and also depends on our parent tags. Thankfully, inside tags that
Expand Down Expand Up @@ -467,7 +468,7 @@ sub _handle_element_end {
# convert, all of which are boolean.
sub format_text {
my ($self, $options, $text) = @_;
my $guesswork = $$options{guesswork} && !$$self{IN_NAME};
my $guesswork = $$options{guesswork} && !$$self{IN_NAME} && !$$self{IN_LINK};
my $cleanup = $$options{cleanup};
my $convert = $$options{convert};
my $literal = $$options{literal};
Expand Down Expand Up @@ -893,6 +894,7 @@ sub start_document {
$$self{INDENTS} = []; # Stack of indentations.
$$self{INDEX} = []; # Index keys waiting to be printed.
$$self{IN_NAME} = 0; # Whether processing the NAME section.
$$self{IN_LINK} = 0; # Whether processing the NAME section.
$$self{ITEMS} = 0; # The number of consecutive =items.
$$self{ITEMTYPES} = []; # Stack of =item types, one per list.
$$self{SHIFTWAIT} = 0; # Whether there is a shift waiting.
Expand Down Expand Up @@ -1321,8 +1323,11 @@ sub cmd_l {
} else {
return "$text <$$attrs{to}>";
}
} elsif ($$attrs{type} eq 'man') {
my ($page, $section) = $text =~ /^([^(]+)(?:[(](\d+)[)])?$/; # Copied from Simple.pm
return '\f(BS' . $page . '\f(BE\|' . "($section)";
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there a better way to apply the bold formatting than using the format codes?

} else {
return $text;
return '\f(BS' . $text . '\f(BE';
}
}

Expand Down
2 changes: 1 addition & 1 deletion t/data/snippets/man/nonbreaking-space-l
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ S<L<RFC4034|https://tools.ietf.org/html/rfc4034>>
S<> wrapping L<> should make the space between the anchor and URL
non-breaking and thus keep them together.
.PP
perl Net::DNS Net::DNS::RR Net::DNS::SEC
\&\fBperl\fR \fBNet::DNS\fR \fBNet::DNS::RR\fR \fBNet::DNS::SEC\fR
RFC2535\ <https://tools.ietf.org/html/rfc2535>
RFC2536\ <https://tools.ietf.org/html/rfc2536>
RFC2931\ <https://tools.ietf.org/html/rfc2931>
Expand Down