Index: Render.pm =================================================================== --- Render.pm (revision 3889) +++ Render.pm (working copy) @@ -828,8 +828,10 @@ my $removed = {}; # Map of placeholders to tag parameters and text - $text =~ s/(\s*\s*)//is; - my $doctype = $1 || ''; + my $doctype = ''; + if ($text =~ s/(\s*\s*)//is) { + $doctype = $1; + } $text = $this->takeOutBlocks( $text, 'verbatim', $removed ); $text = $this->takeOutBlocks( $text, 'head', $removed );