diff --git a/ext/Pod-Html/lib/Pod/Html.pm b/ext/Pod-Html/lib/Pod/Html.pm index 11c25510f934..b1904f3365b1 100644 --- a/ext/Pod-Html/lib/Pod/Html.pm +++ b/ext/Pod-Html/lib/Pod/Html.pm @@ -2,7 +2,7 @@ package Pod::Html; use strict; use Exporter 'import'; -our $VERSION = 1.35; +our $VERSION = 1.36; $VERSION = eval $VERSION; our @EXPORT = qw(pod2html); diff --git a/ext/Pod-Html/lib/Pod/Html/Util.pm b/ext/Pod-Html/lib/Pod/Html/Util.pm index 1231fb31f8f9..e7c349193a62 100644 --- a/ext/Pod-Html/lib/Pod/Html/Util.pm +++ b/ext/Pod-Html/lib/Pod/Html/Util.pm @@ -2,7 +2,7 @@ package Pod::Html::Util; use strict; use Exporter 'import'; -our $VERSION = 1.35; # Please keep in synch with lib/Pod/Html.pm +our $VERSION = 1.36; # Please keep in synch with lib/Pod/Html.pm $VERSION = eval $VERSION; our @EXPORT_OK = qw( anchorify @@ -250,7 +250,9 @@ sub anchorify { $anchor =~ s/"/_/g; # Replace double quotes with underscores $anchor =~ s/_$//; # ... but strip any final underscore $anchor =~ s/[<>&']//g; # Strip the remaining HTML special characters - $anchor =~ s/^\s+//; s/\s+$//; # Strip white space. + $anchor =~ s/^\s+//; # Strip white space. + $anchor =~ s/\s+$//; + $anchor =~ s/^([^a-zA-Z]+)$/pod$1/; # Prepend "pod" if no valid chars. $anchor =~ s/^[^a-zA-Z]+//; # First char must be a letter. $anchor =~ s/[^-a-zA-Z0-9_:.]+/-/g; # All other chars must be valid. diff --git a/ext/Pod-Html/t/lib/Testing.pm b/ext/Pod-Html/t/lib/Testing.pm index e7e524f959dd..25dbe3f98dbc 100644 --- a/ext/Pod-Html/t/lib/Testing.pm +++ b/ext/Pod-Html/t/lib/Testing.pm @@ -2,7 +2,7 @@ package Testing; use 5.10.0; use warnings; use Exporter 'import'; -our $VERSION = 1.35; # Let's keep this same as lib/Pod/Html.pm +our $VERSION = 1.36; # Let's keep this same as lib/Pod/Html.pm $VERSION = eval $VERSION; our @EXPORT_OK = qw( setup_testing_dir