public function substitute( array $substitute )
	{
		foreach( $substitute as $marker => $value )
		{
			$begin = 0;
			$mbegin = (string) str_replace( '$', $marker, $this->_begin );
			$mend = (string) str_replace( '$', $marker, $this->_end );

			while( ( $begin = strpos( $this->_text, $mbegin, $begin ) ) !== false )
			{
				if( ( $end = strpos( $this->_text, $mend, $begin + strlen( $mbegin ) ) ) === false )
				{
					throw new MW_Template_Exception( sprintf( 'Error finding end of marker "%1$s" in template', $marker ) );
				}

				$this->_text = substr_replace( $this->_text, $value, $begin, $end + strlen( $mend ) - $begin );
			}
		}

		return $this;
	}