$page->body, custom plugin loading
[scpubgit/App-SCS.git] / lib / App / SCS / Page.pm
index 0c2e76f..8cc33d9 100644 (file)
@@ -5,6 +5,7 @@ use Time::Local qw(timelocal);
 use Data::Pond qw(pond_read_datum pond_write_datum);
 use List::Util qw(reduce);
 use Module::Runtime qw(use_module);
+use HTML::Zoom;
 use Moo;
 
 has "_$_" => (is => 'ro', init_arg => $_) for qw(page_set);
@@ -114,6 +115,14 @@ sub _html_zoom {
   } HTML::Zoom->from_html($self->html), @{$self->_page_plugins};
 }
 
+sub body {
+  my ($self) = @_;
+  HTML::Zoom->from_html($self->html)
+            ->collect(body => { into => \my @ev })
+            ->run;
+  HTML::Zoom->from_events(\@ev)->to_html;
+}
+
 no Moo;
 
 sub with {