Contents

Parsedown::inlineCode( $Excerpt )

Description

Source

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

1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
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.