Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
use dashes rather than spaces in link targets
  • Loading branch information
haarg committed Jan 5, 2017
1 parent 3d3f904 commit 0bac9e2
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 2 additions & 0 deletions lib/MetaCPAN/Pod/XHTML.pm
Expand Up @@ -74,6 +74,7 @@ sub idify {
$t = decode_entities($t);
$t =~ s/^\s+//;
$t =~ s/\s+$//;
$t =~ s/[\s-]+/-/g;

return $self->url_encode($t)
if $for_link;
Expand All @@ -91,6 +92,7 @@ sub id_extras {
$t = decode_entities($t);
$t =~ s/^\s+//;
$t =~ s/\s+$//;
$t =~ s/[\s-]+/-/g;

# $full will be our preferred linking style, without much filtering
# $first will be the first word, often a method/function name
Expand Down
2 changes: 1 addition & 1 deletion t/pod/renderer.t
Expand Up @@ -21,7 +21,7 @@ EOF

{
my $html = <<'EOF';
<h1 id="DESCRIPTION-Plack">DESCRIPTION <a href="https://metacpan.org/pod/Plack">Plack</a></h1>
<h1 id="DESCRIPTION-Plack"><a id="DESCRIPTION"></a>DESCRIPTION <a href="https://metacpan.org/pod/Plack">Plack</a></h1>
EOF

Expand Down

0 comments on commit 0bac9e2

Please sign in to comment.