<?php
declare(strict_types=1);
namespace League\CommonMark\Input;
use League\CommonMark\Exception\UnexpectedEncodingException;
class MarkdownInput implements MarkdownInputInterface
{
private ?array $lines = null;
private string $content;
private ?int $lineCount = null;
private int $lineOffset;
public function __construct(string $content, int $lineOffset = 0)
{
if (! \mb_check_encoding($content, 'UTF-8')) {
throw new UnexpectedEncodingException('Unexpected encoding - UTF-8 or ASCII was expected');
}
if (\substr($content, 0, 3) === "\xEF\xBB\xBF") {
$content = \substr($content, 3);
}