Contents

Parsedown::inlineEmphasis( $Excerpt )

Description

Source

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

1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
protected function inlineEmphasis($Excerpt)
{
    if ( ! isset($Excerpt['text'][1]))
    {
        return;
    }
 
    $marker = $Excerpt['text'][0];
 
    if ($Excerpt['text'][1] === $marker and preg_match($this->StrongRegex[$marker], $Excerpt['text'], $matches))
    {
        $emphasis = 'strong';
    }
    elseif (preg_match($this->EmRegex[$marker], $Excerpt['text'], $matches))
    {
        $emphasis = 'em';
    }
    else
    {
        return;
    }
 
    return array(
        'extent' => strlen($matches[0]),
        'element' => array(
            'name' => $emphasis,
            'handler' => array(
                'function' => 'lineElements',
                'argument' => $matches[1],
                'destination' => 'elements',
            )
        ),
    );
}

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.