Skip to content

BlockParser ​

php
final readonly class KMark\Block\BlockParser

Reads the lines of a text block by block, with the first kind of block that matches, and gives the HTML.

Source: src/Block/BlockParser.php

Methods ​

__construct() ​

php
public function __construct(InlineParser $inlineParser, Options $options = new Options())

blocks() ​

php
public function blocks(array $lines, bool $tight = false): array

The HTML of each block.

Returns list<string>

parse() ​

php
public function parse(array $lines, bool $tight = false): string

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