]> iEval git - plack-app-gruntmaster.git/blobdiff - lib/Plack/App/Gruntmaster/HTML.pm
Merge branch 'master' into newmc
[plack-app-gruntmaster.git] / lib / Plack / App / Gruntmaster / HTML.pm
index 396f7d9fbdc93e54964e25c869543a37c90bb042..8df45ee4f839113259def81fcadf982c14e813d2 100644 (file)
@@ -10,7 +10,14 @@ use POSIX qw//;
 use Data::Dumper qw/Dumper/;
 
 sub ftime ($)   { POSIX::strftime '%c', localtime shift }
-sub literal ($) { HTML::Element::Library::super_literal shift // '' }
+sub literal ($) {
+       my ($html) = @_;
+       return unless $html;
+       my $b = HTML::TreeBuilder->new;
+       $b->ignore_unknown(0);
+       $b->parse($html);
+       HTML::Element::Library::super_literal $b->guts->as_HTML;
+}
 
 sub HTML::Element::edit_href {
        my ($self, $sub) = @_;
@@ -85,7 +92,7 @@ $logo =~ s/(\s+)/ /g;
 
 sub process_skel {
        my ($tree, %args) = @_;
-       $tree->fid('logo')->replace_with(literal $logo);
+       $tree->fid('logo')->replace_with(HTML::Element::Library::super_literal $logo);
        $tree->content_handler(
                title   =>         $args{title},
                content => literal $args{meat});
This page took 0.017137 seconds and 4 git commands to generate.