public function HamlPreserveFilter::run in Sassy 7
* Run the filter *
Parameters
string text to filter: * @return string filtered text
Overrides HamlBaseFilter::run
File
- phamlp/
haml/ filters/ HamlPreserveFilter.php, line 24
Class
- HamlPreserveFilter
- Preserve Filter for {@link http://haml-lang.com/ Haml} class. Does not parse the filtered text and preserves line breaks. @package PHamlP @subpackage Haml.filters
Code
public function run($text) {
return str_replace("\n", '
', preg_replace(HamlParser::MATCH_INTERPOLATION, '<?php echo \\1; ?>', $text)) . "\n";
}