will matter. It cannot be round a * an input tag in a form tag, for example, where the nesting level will * result in an error. It may also result in a mess in terms of HTML * @tag dev:SOURCE * @package wact * @version $Id: source.tag.php 5945 2007-06-06 08:31:43Z pachanga $ */ class WactDevSourceTag extends WactCompilerTag { /** * Position in the WactCodeWriter::code string containing the compiled code, * at which the dev:source tag was inserted. * @var int */ protected $startPos; /** * Writing mode the WactCodeWriter was in, when the dev:source tag was * inserted * @var int */ protected $startMode; /** * @param WactCodeWriter * @return void */ function generateBeforeContent($code_writer) { $this->startPos = strlen($code_writer->getCode()); $this->startMode = $code_writer->getMode(); } /** * @param WactCodeWriter * @return void */ function generateAfterContent($code_writer) { $source = substr($code_writer->getCode(),$this->startPos); if ( !$this->getBoolAttribute('raw') ) { // Could do this better, perhaps with indents. Course that // needs some kind of parser... or use the Tokenizer. $tmp_source = str_replace('',"\n?>\n",$tmp_source); } else { $tmp_source = $source; } $html_source = highlight_string($tmp_source, true); $html_source = '