You are here

class HamlPreserveFilter in Sassy 7

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

Hierarchy

Expanded class hierarchy of HamlPreserveFilter

File

phamlp/haml/filters/HamlPreserveFilter.php, line 18

View source
class HamlPreserveFilter extends HamlBaseFilter {

  /**
   * Run the filter
   * @param string text to filter
   * @return string filtered text
   */
  public function run($text) {
    return str_replace("\n", '&#x000a;', preg_replace(HamlParser::MATCH_INTERPOLATION, '<?php echo \\1; ?>', $text)) . "\n";
  }

}

Members

Namesort descending Modifiers Type Description Overrides
HamlBaseFilter::init public function * Initialise the filter. 2
HamlPreserveFilter::run public function * Run the filter * Overrides HamlBaseFilter::run