Skip to content

Options ​

php
final readonly class KMark\Options

The 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 = [])
ParameterDescription
$autoLinksturn the bare "http://" and "https://" URLs into links
$unsafeAllowRawHtmlkeep the HTML written in the text instead of escaping it: never use it on a text you do not trust, it allows scripts
$allowedSchemesthe schemes that a link or an image can have, in lowercase; a relative URL is always allowed
$tagsthe 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): Tag

The element of a style: the one that was set, or the default.

Documentation of 2.0.0 , built from f573e5f on 2.0.0 by pipeline #37507527063 on 2026-10-06.