glasserc / phphaml

fork of phphaml to integrate bug fixes -- unmaintained
http://phphaml.sourceforge.net/
21 stars 8 forks source link

Filters #3

Open derDoc opened 11 years ago

derDoc commented 11 years ago

Filter handling is broken, due to the subclassing of HamlLine to HamlParser. HamlLine does not implement the method getAsSource(). Changing line 1284 to read

$oHaml = new HamlParser($this->sPath, $this->bCompile, $parent, array('line'=>$iLine, 'file'=>$this->sFile));

however fixes this. Furthermore, since SassParser implements sass() as a static method the callable must be passed to registerBlock in line 217 as follows:

self::registerBlock(__NAMESPACE__ .'\SassParser::sass', 'sass');

The array(instance, method) only works for non-static methods. I will submit patches for this (or a pull request) soon.