добавлена markdown-процессинг текста при выводе точки
This commit is contained in:
parent
946ed45a45
commit
c1bfd7def6
|
|
@ -3,6 +3,11 @@
|
||||||
class Markdown
|
class Markdown
|
||||||
{
|
{
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Польная обработка разметки (включая заголовки)
|
||||||
|
* @param string $string исходная строка
|
||||||
|
* @return string результат
|
||||||
|
*/
|
||||||
static function processing($string)
|
static function processing($string)
|
||||||
{
|
{
|
||||||
$string = self::replaceHeaders($string);
|
$string = self::replaceHeaders($string);
|
||||||
|
|
@ -15,6 +20,11 @@ class Markdown
|
||||||
return $string;
|
return $string;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Обработка разметки без учёта заголовков
|
||||||
|
* @param string $string исходная строка
|
||||||
|
* @return string результат
|
||||||
|
*/
|
||||||
static function liteProcessing($string)
|
static function liteProcessing($string)
|
||||||
{
|
{
|
||||||
// $string = self::replaceHeaders($string);
|
// $string = self::replaceHeaders($string);
|
||||||
|
|
@ -90,6 +100,11 @@ class Markdown
|
||||||
return $string;
|
return $string;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Срочно написать описание!
|
||||||
|
* @param type $string
|
||||||
|
* @return type
|
||||||
|
*/
|
||||||
static function getClear($string)
|
static function getClear($string)
|
||||||
{
|
{
|
||||||
// Headers
|
// Headers
|
||||||
|
|
|
||||||
|
|
@ -53,7 +53,8 @@ class JsonController extends Controller
|
||||||
if ($id) {
|
if ($id) {
|
||||||
$point = Point::model()->getByPK($id);
|
$point = Point::model()->getByPK($id);
|
||||||
|
|
||||||
$point->descriptionHtml = nl2br($point->description);
|
$point->descriptionHtml = Markdown::liteProcessing($point->description);
|
||||||
|
$point->descriptionHtml = nl2br($point->descriptionHtml);
|
||||||
$point->descriptionHtml = Helper::replaceLinks($point->descriptionHtml, 'js');
|
$point->descriptionHtml = Helper::replaceLinks($point->descriptionHtml, 'js');
|
||||||
$point->name = htmlspecialchars($point->name);
|
$point->name = htmlspecialchars($point->name);
|
||||||
$imgs = $point->photos;
|
$imgs = $point->photos;
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue