public function parse(InlineParserContext $inlineContext)
{
$inlineContext->getCursor()->advance();
// Check previous inline for trailing spaces
$spaces = 0;
$lastInline = $inlineContext->getContainer()->lastChild();
if ($lastInline && $lastInline instanceof Text) {
$trimmed = rtrim($lastInline->getContent(), ' ');
$spaces = strlen($lastInline->getContent()) - strlen($trimmed);
if ($spaces) {
$lastInline->setContent($trimmed);
}
}
if ($spaces >= 2) {
$inlineContext->getContainer()->appendChild(new Newline(Newline::HARDBREAK));
} else {
$inlineContext->getContainer()->appendChild(new Newline(Newline::SOFTBREAK));
}
return true;
}