text($text); } public function parseLine(string $line): string { return $this->line($line); } protected function inlineImage($excerpt) { // remove this line when media detection works entirely as expected return parent::inlineImage($excerpt); if(!isset($excerpt['text'][1]) || $excerpt['text'][1] !== '[') return; $excerpt['text'] = substr($excerpt['text'], 1); $link = $this->inlineLink($excerpt); if($link === null) return; $inline = [ 'extent' => $link['extent'] + 1, 'element' => [ 'name' => 'span', 'attributes' => [ 'class' => 'js-msz-embed-media', 'data-msz-embed-url' => $link['element']['attributes']['href'], 'data-msz-embed-alt' => $link['element']['text'], ], ], ]; $inline['element']['attributes'] += $link['element']['attributes']; unset($inline['element']['attributes']['href']); return $inline; } }