if ($rule_name) { $h .= " <h4>{$rule_title}" . ($rule_name ? "<sub><small>{$rule_name}</small></sub>" : "") . "</h4>"; } $code = htmlspecialchars($result); $code_raw = htmlspecialchars($result_raw); $h .= " Результат: <div style='margin-left:30px;'>{$result}</div><br />"; $h .= " HTML-код: <pre style='margin-left:30px;'>{$code}</pre>"; $h .= " <div class='rawhtmlcode' style='display:none'>Не обработанный HTML-код: <pre style='margin-left:30px;'>{$code_raw}</pre></div>"; $h .= " </div>"; $h .= "</div>"; return $h; } $prev = ""; foreach ($typograph->debug_info as $debug) { if ($debug['tret']) { $tr = $typograph->get_tret($debug['class']); $tt = "Трэт: " . $tr->title; $tn = $debug['class']; $rt = $tr->rules[$debug['place']]['description']; $rn = $debug['place']; } else { $rt = ""; $rn = ""; $tn = ""; switch ($debug['place']) { case "init": $tt = "До обработки типографом"; break; case "safe_blocks": $tt = "Включение безопасных блоков"; break;
foreach ($list as $file) { $s = phpfile_read("../src-php/{$file}", $action == "installerpy"); fputs($fp, $s); } fprintf($fp, "?>"); fclose($fp); echo "Сгенерирован скрипт типографа для PHP<br />"; } if ($action == "installerpy") { require_once "../EMT.forpy.php"; $z = file_get_contents("../src-py/EMT.py"); require_once "builder.py.php"; $tretsx = array(); $typograf = new EMTypograph(); foreach ($typograf->trets as $tret) { $tretx = $typograf->get_tret($tret); $tretsx[] = work_for_py($tretx); } $zz = str_replace("#####EMT_TRETS#####", implode("", $tretsx), $z); file_put_contents("../EMT.py", $zz); @unlink("../EMT.forpy.php"); echo "Сгенерирован скрипт типографа для Python<br />"; } if ($action == "testpy") { $noecho = 1; require_once "../tools-php/test.php"; $list = FS::list_only_files("../tests/", '/^test\\.[0-9a-z\\.\\-_]+\\.php$/i'); if (count($list) > 0) { $tester = new EMTTester(); $tester->double_test = isset($_GET['double_test']); $tester->set_typoclass("EMTypograph");