1<?php
2
3class syntax_plugin_codeprism_code extends syntax_plugin_codeprism_codeprism
4{
5	protected $entry_pattern = '<code\b.*?>(?=.*?</code>)';
6	protected $exit_pattern = '</code>';
7	protected $match_pattern = '/<code (.+?)( \[(.+?)\])* *>/';
8
9	private function override_syntax_code()
10	{
11		return $this->getConf('override-code');
12	}
13
14	public function connectTo($mode)
15	{
16		if (isset($_REQUEST['comment']) || !$this->override_syntax_code()) {
17				return false;
18		}
19
20		$this->Lexer->addEntryPattern($this->entry_pattern, $mode, 'plugin_codeprism_code');
21	}
22
23	public function postConnect()
24	{
25		$this->Lexer->addExitPattern($this->exit_pattern, 'plugin_codeprism_code');
26	}
27}
28