Skip to content

Emphasis ​

php
final readonly class KMark\Inline\Emphasis

The text styles. As in the original Markdown, *x* and _x_ are italic and **x** and __x__ are bold. --x-- and, as on GitHub, ~~x~~ are strikethrough, written as deleted text. ++x++ is underline, which Markdown does not have.

An underscore inside a word is not a marker, so snake_case_name stays as it is.

Each style is written with the element of the option "tags". When two styles use the same element with classes, they are merged into one: bold and italic as "span" give <span class="b i">.

Source: src/Inline/Emphasis.php

Methods ​

__construct() ​

php
public function __construct(Options $options = new Options())

render() ​

php
public function render(string $text): string

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