mirror of
https://github.com/samclarke/SBBCodeParser.git
synced 2026-01-09 14:18:41 +00:00
27 lines
476 B
PHP
27 lines
476 B
PHP
<?php
|
|
|
|
namespace SBBCodeParser;
|
|
|
|
class Node_Text extends Node
|
|
{
|
|
protected $text;
|
|
|
|
|
|
public function __construct($text)
|
|
{
|
|
$this->text = $text;
|
|
}
|
|
|
|
public function get_html($nl2br=true)
|
|
{
|
|
if(!$nl2br)
|
|
return str_replace(" ", " ", htmlentities($this->text, ENT_QUOTES | ENT_IGNORE, "UTF-8"));
|
|
|
|
return str_replace(" ", " ", nl2br(htmlentities($this->text, ENT_QUOTES | ENT_IGNORE, "UTF-8")));
|
|
}
|
|
|
|
public function get_text()
|
|
{
|
|
return $this->text;
|
|
}
|
|
} |