Parsedown::inlineImage( $Excerpt )

Description

Source

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

1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
protected function inlineImage($Excerpt)
{
    if ( ! isset($Excerpt['text'][1]) or $Excerpt['text'][1] !== '[')
    {
        return;
    }
 
    $Excerpt['text']= substr($Excerpt['text'], 1);
 
    $Link = $this->inlineLink($Excerpt);
 
    if ($Link === null)
    {
        return;
    }
 
    $Inline = array(
        'extent' => $Link['extent'] + 1,
        'element' => array(
            'name' => 'img',
            'attributes' => array(
                'src' => $Link['element']['attributes']['href'],
                'alt' => $Link['element']['handler']['argument'],
            ),
            'autobreak' => true,
        ),
    );
 
    $Inline['element']['attributes'] += $Link['element']['attributes'];
 
    unset($Inline['element']['attributes']['href']);
 
    return $Inline;
}

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.