--- /Users/cowens/src/padre/trunk/Padre/lib/Padre/Pod2HTML.pm	2009-09-10 16:36:15.000000000 -0400
+++ Pod2HTML.pm	2009-09-11 00:47:53.000000000 -0400
@@ -47,6 +47,14 @@
 	$self->{html} = '';
 	$self->parse_string_document($input);
 
+	#FIXME: this takes care of a bug in Pod::Simple::XHTML
+	$self->{html} =~ s/<</&lt&lt;/g;
+	$self->{html} =~ s/< /&lt /g;
+	$self->{html} =~ s/<=/&lt=/g;
+
+	#FIXME: this is incredibly bad, but the anchors are predictible
+	$self->{html} =~ s#<a href=".*?">|</a>##g;
+
 	return $self->{html};
 }
 
@@ -56,21 +64,16 @@
 # Prevent binding to STDOUT
 sub new {
 	my $class = shift;
-	my $self = $class->SUPER::new( output_fh => 1, @_ );
+	my $self = $class->SUPER::new(@_);
 
 	# Ignore POD irregularities
 	$self->no_whining(1);
 	$self->no_errata_section(1);
+	$self->output_string(\$self->{html});
 
 	return $self;
 }
 
-# Override emit to build html from scratch :)
-sub emit {
-	my $self = shift;
-	$self->{html} .= $self->{scratch};
-}
-
 #####################################################################
 # Customize HTML generation
 
