Appearance
Options
php
final readonly class KMark\OptionsThe settings of a conversion. The object is immutable: use the named arguments to change a setting.
new Options(autoLinks: false, allowedSchemes: ['https']);
Source: src/Options.php
Methods
__construct()
php
public function __construct(bool $autoLinks = true, bool $unsafeAllowRawHtml = false, array $allowedSchemes = ['http', 'https', 'mailto', 'tel', 'ftp'], array $tags = [])| Parameter | Description |
|---|---|
$autoLinks | turn the bare "http://" and "https://" URLs into links |
$unsafeAllowRawHtml | keep the HTML written in the text instead of escaping it: never use it on a text you do not trust, it allows scripts |
$allowedSchemes | the schemes that a link or an image can have, in lowercase; a relative URL is always allowed |
$tags | the element that writes a style, by style: "bold" (default <b>), "italic" (<i>), "underline" (<u>) and "strike" (<del>) |
Throws InvalidArgumentException when a scheme or a style is not valid
tag()
php
public function tag(string $style): TagThe element of a style: the one that was set, or the default.