1 | <?php |
||
4 | class Etc extends AbstractTret |
||
5 | { |
||
6 | |||
7 | public $classes = array( |
||
8 | 'nowrap' => 'word-spacing:nowrap;', |
||
9 | ); |
||
10 | |||
11 | /** |
||
12 | * Базовые параметры тофа |
||
13 | * |
||
14 | * @var array |
||
15 | */ |
||
16 | public $title = "Прочее"; |
||
17 | public $rules = array( |
||
18 | 'acute_accent' => array( |
||
19 | 'description' => 'Акцент', |
||
20 | 'pattern' => '/(у|е|ы|а|о|э|я|и|ю|ё)\`(\w)/i', |
||
21 | 'replacement' => '\1́\2' |
||
22 | ), |
||
23 | |||
24 | 'word_sup' => array( |
||
25 | 'description' => 'Надстрочный текст после символа ^', |
||
26 | 'pattern' => '/((\s|\ \;|^)+)\^([a-zа-яё0-9\.\:\,\-]+)(\s|\ \;|$|\.$)/ieu', |
||
27 | 'replacement' => '"" . $this->tag($this->tag($m[3],"small"),"sup") . $m[4]' |
||
28 | ), |
||
29 | 'century_period' => array( |
||
30 | 'description' => 'Тире между диапозоном веков', |
||
31 | 'pattern' => '/(\040|\t|\ \;|^)([XIV]{1,5})(-|\&mdash\;)([XIV]{1,5})(( |\ \;)?(в\.в\.|вв\.|вв|в\.|в))/eu', |
||
32 | 'replacement' => '$m[1] .$this->tag($m[2]."—".$m[4]." вв.","span", array("class"=>"nowrap"))' |
||
33 | ), |
||
34 | 'time_interval' => array( |
||
35 | 'description' => 'Тире и отмена переноса между диапозоном времени', |
||
36 | 'pattern' => '/([^\d\>]|^)([\d]{1,2}\:[\d]{2})(-|\&mdash\;|\&minus\;)([\d]{1,2}\:[\d]{2})([^\d\<]|$)/eui', |
||
37 | 'replacement' => '$m[1] . $this->tag($m[2]."—".$m[4],"span", array("class"=>"nowrap")).$m[5]' |
||
38 | ), |
||
39 | 'expand_no_nbsp_in_nobr' => array( |
||
40 | 'description' => 'Удаление nbsp в nobr/nowrap тэгах', |
||
41 | 'function' => 'remove_nbsp' |
||
42 | ), |
||
43 | ); |
||
44 | |||
45 | protected function remove_nbsp() |
||
64 | |||
65 | } |
||
66 |