Method | Description | |
---|---|---|
__construct ( ) | Constructor preventing from creating instances of a static class. | |
fromText ( string $text, boolean $convertLinks = true ) : string | Converts text to HTML source code. | |
getBody ( string $html ) : string | Returns contents from the given HTML source. | |
is ( string $text ) : boolean | Tests if the given text contains at least one HTML tag. | |
linkFromText ( string $text ) : string | Converts text to a link to an url or email. | |
removeAttributes ( string $html, array $attributes = [] ) : string | Removes given attributes from the HTML source. | |
removeDangerous ( string $html ) : string | Removes possibly dangerous attributes that could contain XSS code from the HTML source. | |
removeInnerTags ( string $html, string $tag ) : string | Removes tags of the same type nested into each other from the HTML source. | |
removeJavascriptEvents ( string $html ) : string | Removes all javascript events from the HTML source. | |
removeRemoteImages ( string $html ) : string | Removes foreign images from the HTML source. | |
removeTags ( string $html, array $tags = [] ) : string | Removes given tags from the HTML source. | |
repair ( string $html ) : string | Fixes an invalid HTML source, unifies quotes and removes unnecessary whitespace. | |
toText ( string $html ) : string | Converts HTML source code to plaintext. |
Method | Description | |
---|---|---|
blockquoteToText ( string $text ) : string | Converts citations into plaintext. | |
linkToText ( string $text ) : string | Converts HTML links into plaintext. | |
listToText ( string $text ) : string | Converts HTML lists to plaintext. |
final public __construct ( ) |
public static linkFromText ( string $text ) : string | ||
$text | string | Input text |
return | string |
public static removeDangerous ( string $html ) : string | ||
$html | string | HTML source code |
return | string |
public static removeJavascriptEvents ( string $html ) : string | ||
$html | string | HTML source code |
return | string |
public static removeRemoteImages ( string $html ) : string | ||
$html | string | HTML source code |
return | string |