# danog\MadelineProto\WebUI\SafeHtml: A trusted HTML fragment, output as-is by templates instead of being escaped.

> 
Only wrap markup that does not contain user input.


[Back to index](../../../index.html)

> Author: Daniil Gentili <daniil@daniil.it>  
  

A trusted HTML fragment, output as-is by templates instead of being escaped.  


Only wrap markup that does not contain user input.


## Properties
* `$html`: `string` 

## Method list:
* [`__construct(string $html)`](#__construct)
* [`escape(string $text): \danog\MadelineProto\WebUI\SafeHtml`](#escape)
* [`linkify(string $text): \danog\MadelineProto\WebUI\SafeHtml`](#linkify)
* [`jsonSerialize(): array`](#jsonSerialize)

## Methods:
### <a name="__construct"></a> `__construct(string $html)`




Parameters:

* `$html`: `string`   



### <a name="escape"></a> `escape(string $text): \danog\MadelineProto\WebUI\SafeHtml`

Escape a plain string into a safe HTML fragment.


Parameters:

* `$text`: `string`   



### <a name="linkify"></a> `linkify(string $text): \danog\MadelineProto\WebUI\SafeHtml`

Escape a plain string, turning the URLs it contains into links.


Parameters:

* `$text`: `string`   



### <a name="jsonSerialize"></a> `jsonSerialize(): array`

Serialized as `{"html": "..."}`, to tell it apart from plain text.



---
Generated by [danog/phpdoc](https://phpdoc.daniil.it)
