Jake Vanderwerf
2 hours ago 57d34239ee9ddb0bafe7b451edd766c2089fc9d7
blocks/_setup.php
@@ -78,4 +78,26 @@
        AJV_URL.'/assets/img/'.$imgs[$rand]['img'].'.png',
        $imgs[$rand]['alt'],
        );
}
function altr_prerender_core_quote(array $block, ?string $content, ?WP_Block $parent):?string
{
    $innerHTML = $block['innerHTML'];
    $handler = JVB()->blocks();
    // Extract cite content first
    $cite = $handler->extractElement($innerHTML, 'cite');
    $citeHtml = ($cite === '') ? '' : '<cite>—&emsp;'.$cite.'</cite>';
    // Get the blockquote content
    $content = $handler->innerBlocks($block);
    // Remove the cite element from content if it exists
    if ($cite !== '') {
        $content = $handler->stripTagContents('cite', $content);
    }
    return '<blockquote'.$handler->getClassesAndStyles($block['attrs']??[]).'>
        <div class="content">'.$content.'</div>'.
        $citeHtml.
        '</blockquote>';
}