Skip to content

Convert ​

php
final readonly class KMark\Convert

KMark converts Markdown to HTML, as the original Markdown does, and lets you set an id and CSS classes on the elements with "{#id .class}".

Copyright (c) 2013 Stanislas Poisson - MIT license https://stanislas-poisson.fr

Source: src/Convert.php

Methods ​

__construct() ​

php
public function __construct(Options $options = new Options(), string $text = '')

toHtml() ​

php
public static function toHtml(string $text, Options $options = null): string

Converts a text in one call.

convert() ​

php
public function convert(): self

A converter that holds the text of this one, converted to HTML.

getText() ​

php
public function getText(): string

withText() ​

php
public function withText(string $text): self

A converter that has the same options and holds the given text.

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