4 * Converts documents that have the xc-fragment class on the body
5 * element into HTML fragments, which are only the contents of the
8 class XHTMLCompiler_TextFilter_Fragment
extends XHTMLCompiler_TextFilter
11 var $name = 'Fragment';
13 public function process($text, $page, $manager) {
14 if (strpos($text, '<body class="xc-fragment">') === false) return $text;
15 preg_match('/<body class="xc-fragment">(.+?)<\/body>/s', $text, $matches);
16 file_put_contents($page->getPathStem() . '.frag', $matches[1]);