parseInline($matches[1])
],
strlen($matches[0])
];
}
return [['text', $markdown[0] . $markdown[1]], 2];
}
protected function renderSup($block): string
{
return ''
. $this->renderAbsy($block[1])
. '';
}
protected function parseSubMarkers(): array
{
return array('--');
}
/**
* Parses the subscript feature.
*
* @marker --
*/
protected function parseSub($markdown): array
{
if (
preg_match(
'/^--(?!-)(.*?([^-\\\\]|(?<=\\\\)-|(?<=\\\\)\\\\))--(?!-)/s',
$markdown,
$matches
)
) {
return [
[
'sub',
$this->parseInline($matches[1])
],
strlen($matches[0])
];
}
return [['text', $markdown[0] . $markdown[1]], 2];
}
protected function renderSub($block): string
{
return ''
. $this->renderAbsy($block[1])
. '';
}
abstract protected function parseInline($text);
abstract protected function renderAbsy($blocks);
}