Skip to content

Instantly share code, notes, and snippets.

@vti
Created September 28, 2010 16:47
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save vti/36e4f7c102ae174b3d3f to your computer and use it in GitHub Desktop.
Save vti/36e4f7c102ae174b3d3f to your computer and use it in GitHub Desktop.
diff --git a/lib/Mojolicious/Plugin/PodRenderer.pm b/lib/Mojolicious/Plugin/PodRenderer.pm
index 8f6bee5..443931c 100644
--- a/lib/Mojolicious/Plugin/PodRenderer.pm
+++ b/lib/Mojolicious/Plugin/PodRenderer.pm
@@ -62,8 +62,8 @@ sub _pod_to_html {
return $@ if $@;
# Filter
- $output =~ s/<a name='___top' class='dummyTopAnchor'\s*><\/a>\n//g;
- $output =~ s/<a class='u'.*name=".*"\s*>(.*)<\/a>/$1/sg;
+ $output =~ s/<a name='___top' class='dummyTopAnchor'\s*?><\/a>\n//g;
+ $output =~ s/<a class='u'.*?name=".*?"\s*>(.*?)<\/a>/$1/sg;
return $output;
}
diff --git a/t/mojolicious/pod_renderer_lite_app.t b/t/mojolicious/pod_renderer_lite_app.t
index 1e3f0d3..84e67e8 100644
--- a/t/mojolicious/pod_renderer_lite_app.t
+++ b/t/mojolicious/pod_renderer_lite_app.t
@@ -48,7 +48,7 @@ $t->get_ok('/')->status_is(200)
# POD helper
$t->post_ok('/')->status_is(200)
- ->content_like(qr/test123\s+<h1>lalala<\/h1>\s+<p><code>test<\/code><\/p>/);
+ ->content_like(qr/test123\s+<h1>lalala<\/h1>\s+<h1>lololo<\/h1>\s+<p><code>test<\/code><\/p>/);
# POD filter
$t->post_ok('/block')->status_is(200)
@@ -57,7 +57,7 @@ $t->post_ok('/block')->status_is(200)
__DATA__
@@ index.html.ep
-test123<%= pod_to_html "=head1 lalala\n\nC<test>"%>
+test123<%= pod_to_html "=head1 lalala\n\n=head1 lololo\n\nC<test>"%>
@@ block.html.ep
test321<%= pod_to_html begin %>=head2 lalala
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment