projects
/
plack-app-gruntmaster.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
a7e836f
)
Parse and reserialize literal HTML
author
Marius Gavrilescu
<marius@ieval.ro>
Sat, 11 Apr 2015 11:57:02 +0000
(14:57 +0300)
committer
Marius Gavrilescu
<marius@ieval.ro>
Sat, 11 Apr 2015 11:57:02 +0000
(14:57 +0300)
lib/Plack/App/Gruntmaster/HTML.pm
patch
|
blob
|
blame
|
history
diff --git
a/lib/Plack/App/Gruntmaster/HTML.pm
b/lib/Plack/App/Gruntmaster/HTML.pm
index ebbc145e22cd3bd9f328c3e3a8da27b749d9e9c8..3cfbc54be43acb876d8bce726fc61b442ece0d1b 100644
(file)
--- a/
lib/Plack/App/Gruntmaster/HTML.pm
+++ b/
lib/Plack/App/Gruntmaster/HTML.pm
@@
-10,7
+10,12
@@
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 $b = HTML::TreeBuilder->new;
+ $b->ignore_unknown(0);
+ $b->parse(shift // '');
+ HTML::Element::Library::super_literal $b->guts->as_HTML;
+}
sub HTML::Element::edit_href {
my ($self, $sub) = @_;
This page took
0.009852 seconds
and
4
git commands to generate.