Permalink
Browse files

Simplified regex and added comment why backslashes are being converted

  • Loading branch information...
Htbaa committed Feb 26, 2011
1 parent dc52fec commit 0acdb2fcdedb643e1dab3c144e148bd1fdd8082b
Showing with 3 additions and 2 deletions.
  1. +3 −2 lib/MojoX/Renderer/TT.pm
View
@@ -150,8 +150,9 @@ sub _template_content {
my $self = shift;
my ($path) = @_;
- my ($t) = ($path =~ m{templates[\/|\\](.*)$});
- $t =~ s/\\/\//g;
+ # Convert backslashes to forward slashes to make inline templates work on Windows
+ $path =~ s/\\/\//g;
+ my ($t) = ($path =~ m{templates\/(.*)$});
if (-r $path) {
return $self->SUPER::_template_content(@_);

0 comments on commit 0acdb2f

Please sign in to comment.