diff --git a/lib/Pod/Simple/XHTML.pm b/lib/Pod/Simple/XHTML.pm
index 0831e52b..9a0f1f9a 100644
--- a/lib/Pod/Simple/XHTML.pm
+++ b/lib/Pod/Simple/XHTML.pm
@@ -249,7 +249,7 @@ sub new {
$new->{'to_index'} = [];
$new->{'output'} = [];
$new->{'saved'} = [];
- $new->{'ids'} = {};
+ $new->{'ids'} = { '_podtop_' => 1 }; # used in
$new->{'in_li'} = [];
$new->{'__region_targets'} = [];
@@ -408,7 +408,7 @@ sub _end_head {
my $id = $_[0]->idify($_[0]{scratch});
my $text = $_[0]{scratch};
$_[0]{'scratch'} = $_[0]->backlink && ($h - $add == 0) # backlinks enabled && =head1
- ? qq{$text}
+ ? qq{$text}
: qq{$text};
$_[0]->emit;
push @{ $_[0]{'to_index'} }, [$h, $id, $text];
@@ -477,7 +477,7 @@ $doctype
$title
$metatags
-
+
HTML
$self->emit;
}
diff --git a/t/xhtml10.t b/t/xhtml10.t
index 2aeb3ccb..5a3b4a14 100644
--- a/t/xhtml10.t
+++ b/t/xhtml10.t
@@ -44,7 +44,7 @@ is $results, <<'EOF', 'Should have the index';
-
+
@@ -409,14 +409,14 @@ is $results, <<'EOF', 'Should have the index and a backlink';
-
+
-Foo
+Foo
@@ -435,7 +435,7 @@ is $results, <<'EOF', 'Should have the index and backlinks';
-
+
@@ -447,12 +447,11 @@ is $results, <<'EOF', 'Should have the index and backlinks';
- Baz
-
-Foo
+Foo
Bar
-Baz
+Baz
@@ -472,12 +471,12 @@ is $results, <<'EOF', 'Should have backlinks but no index';
-
+
-Foo
+Foo
-Bar
+Bar
@@ -497,7 +496,7 @@ is $results, <<'EOF', 'Should have index and backlinks around h2 elements';
-
+
@@ -509,9 +508,9 @@ is $results, <<'EOF', 'Should have index and backlinks around h2 elements';
-Foo
+Foo
-Bar
+Bar