◆ apply()
| static apply |
( |
|
$markup, |
|
|
|
$text, |
|
|
|
$trim |
|
) |
| |
|
static |
Apply markup rules and clean the text up.
- Parameters
-
| TextFormat | $markup | Markup rules applied on marked-up text. |
| string | $text | Marked-up text on which rules are applied. |
| boolean | $trim | Trim text before applying markup rules, if TRUE. |
- Returns
- string HTML code computed from marked-up text.
◆ hasHtmlMarker()
| static hasHtmlMarker |
( |
|
$text | ) |
|
|
static |
◆ htmlReady()
| static htmlReady |
( |
|
$text, |
|
|
|
$trim = true, |
|
|
|
$br = false, |
|
|
|
$double_encode = true |
|
) |
| |
|
static |
Convert special characters to HTML entities, and clean up.
- Parameters
-
| string | $text | This text's special chars will be converted. |
| boolean | $trim | Trim text before applying markup rules, if TRUE. |
| boolean | $br | Replace newlines by
, if TRUE. |
| boolean | $double_encode | Encode existing HTML entities, if TRUE. |
- Returns
- string The converted string.
◆ isHtml()
Return true for HTML code and false for plain text.
HTML code must either match HTML_MARKER_REGEXP or begin with '<' and end with '>' (leading and trailing whitespace is ignored). Everything else is considered to be plain text.
- Parameters
-
| string | $text | HTML code or plain text. |
- Returns
- boolean
true for HTML code, false for plain text.
◆ markAsHtml()
| static markAsHtml |
( |
|
$text | ) |
|
|
static |
Mark a given text as HTML code.
No sanity-checking is done on the given text. It is simply marked up so to be identified by Markup::isHtml as HTML code.
- Parameters
-
| string | $text | The text to be marked up as HTML code. |
- Returns
- string The text marked up as HTML code.
◆ purify()
| static purify |
( |
|
$dirty_html | ) |
|
|
static |
Call HTMLPurifier to create safe HTML.
- Parameters
-
| string | $dirty_html | Unsafe or 'uncleaned' HTML code. |
- Returns
- string Clean and safe HTML code.
◆ purifyHtml()
| static purifyHtml |
( |
|
$html | ) |
|
|
static |
Call HTMLPurifier to filter the HTML code (if the source is detected to contain HTML, returns the argument unchanged otherwise). The HTML marker is restored afterwards, if it was present.
- Parameters
-
| string | $dirty_html | Unsafe or 'uncleaned' HTML code. |
- Returns
- string Clean and safe HTML code.
◆ removeHTML()
| static removeHTML |
( |
|
$html | ) |
|
|
static |
◆ HTML_MARKER
Initial value:=
'<!-- HTML: Insert text after this line only. -->'
◆ HTML_MARKER_REGEXP
Initial value:=
'^[\s\n]*<!--[\s\n]*[Hh][Tt][Mm][Ll][^->]*-->'
The documentation for this class was generated from the following file: