Contents

Parsedown::inlineCode( $Excerpt )

Description

Source

File: bp-help/vendors/parsedown/Parsedown.php

    protected function inlineCode($Excerpt)
    {
        $marker = $Excerpt['text'][0];

        if (preg_match('/^(['.$marker.']++)[ ]*+(.+?)[ ]*+(?<!['.$marker.'])\1(?!'.$marker.')/s', $Excerpt['text'], $matches))
        {
            $text = $matches[2];
            $text = preg_replace('/[ ]*+\n/', ' ', $text);

            return array(
                'extent' => strlen($matches[0]),
                'element' => array(
                    'name' => 'code',
                    'text' => $text,
                ),
            );
        }
    }

Questions?

We're always happy to help with code or other questions you might have! Search our developer docs, contact support, or connect with our sales team.